Skip to content

Commit

Permalink
feat: add combobox autocomplete=off functionality #109
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanjones243 committed Jan 17, 2025
1 parent 2203caf commit 10b22c4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions components/combobox/demo/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

| Property | Attribute | Type | Default | Description |
|---------------------------------|---------------------------------|-----------|-------------|--------------------------------------------------|
| [autocomplete](#autocomplete) | `autocomplete` | `string` | | An enumerated attribute that defines what the user agent can suggest for autofill. At this time, only `autocomplete="off"` is supported. |
| [checkmark](#checkmark) | `checkmark` | `boolean` | | When attribute is present auro-menu will apply checkmarks to selected options. |
| [disabled](#disabled) | `disabled` | `boolean` | | If set, disables the combobox. |
| [error](#error) | `error` | `string` | | When defined, sets persistent validity to `customError` and sets the validation message to the attribute value. |
Expand Down
1 change: 1 addition & 0 deletions components/combobox/docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

| Property | Attribute | Type | Default | Description |
|---------------------------------|---------------------------------|-----------|-------------|--------------------------------------------------|
| `autocomplete` | `autocomplete` | `string` | | An enumerated attribute that defines what the user agent can suggest for autofill. At this time, only `autocomplete="off"` is supported. |
| `checkmark` | `checkmark` | `boolean` | | When attribute is present auro-menu will apply checkmarks to selected options. |
| `disabled` | `disabled` | `boolean` | | If set, disables the combobox. |
| `error` | `error` | `string` | | When defined, sets persistent validity to `customError` and sets the validation message to the attribute value. |
Expand Down
9 changes: 9 additions & 0 deletions components/combobox/src/auro-combobox.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ export class AuroCombobox extends LitElement {
return {
// ...super.properties,

/**
* An enumerated attribute that defines what the user agent can suggest for autofill. At this time, only `autocomplete="off"` is supported.
*/
autocomplete: {
type: String,
reflect: true
},

/**
* When attribute is present auro-menu will apply checkmarks to selected options.
*/
Expand Down Expand Up @@ -697,6 +705,7 @@ export class AuroCombobox extends LitElement {
setCustomValidity="${this.setCustomValidity}"
setCustomValidityValueMissing="${this.setCustomValidityValueMissing}"
setCustomValidityCustomError="${this.setCustomValidityCustomError}"
.autocomplete="${this.autocomplete}"
.type="${this.type}"
@input="${this.handleInputValueChange}">
<slot name="label" slot="label"></slot>
Expand Down

0 comments on commit 10b22c4

Please sign in to comment.