Skip to content

Commit

Permalink
♿ a11y(bal-textarea & bal-date): add autocomplete attribute (#1539)
Browse files Browse the repository at this point in the history
* Create PR for #1535

* fix(a11y): introduce autocomplete for bal-date and bal-textarea

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Marco Zirkenbach <[email protected]>
  • Loading branch information
github-actions[bot] and baldummy authored Dec 5, 2024
1 parent 0b5db09 commit 9e5ee7a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/nice-onions-greet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@baloise/ds-core': patch
---

**text**: introduce autocomplete for bal-textarea
5 changes: 5 additions & 0 deletions .changeset/red-peas-relate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@baloise/ds-core': patch
---

**date**: introduce autocomplete for bal-date
6 changes: 6 additions & 0 deletions packages/core/src/components/bal-date/bal-date.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ export class Date implements ComponentInterface, Loggable, BalAriaFormLinking {
*/
@Prop() closeOnSelect = true

/**
* Indicates whether the value of the control can be automatically completed by the browser.
*/
@Prop() autocomplete: BalProps.BalInputAutocomplete = 'off'

/**
* The value of the form field, which accepts ISO 8601 date strings (YYYY-MM-DD).
*/
Expand Down Expand Up @@ -502,6 +507,7 @@ export class Date implements ComponentInterface, Loggable, BalAriaFormLinking {
readonly={this.readonly}
disabled={this.disabled}
allowInvalidValue={this.allowInvalidValue}
autocomplete={this.autocomplete}
onClick={this.onInputClick}
onBalInput={this.onInputInput}
onBalChange={this.onInputChange}
Expand Down
6 changes: 6 additions & 0 deletions packages/core/src/components/bal-textarea/bal-textarea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ export class Textarea implements ComponentInterface, FormInput<string | undefine
*/
@Prop() autocapitalize = 'none'

/**
* Indicates whether the value of the control can be automatically completed by the browser.
*/
@Prop() autocomplete: BalProps.BalInputAutocomplete = 'off'

/**
* This Boolean attribute lets you specify that a form control should have input focus when the page loads.
*/
Expand Down Expand Up @@ -297,6 +302,7 @@ export class Textarea implements ComponentInterface, FormInput<string | undefine
readonly={this.readonly}
required={this.required}
autoCapitalize={this.autocapitalize}
autocomplete={this.autocomplete}
autoFocus={this.autofocus}
minLength={this.minLength}
maxLength={this.maxLength}
Expand Down

0 comments on commit 9e5ee7a

Please sign in to comment.