Skip to content

Commit

Permalink
feat(autocomplete): add html5 autocomplete functionality #334
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanjones243 authored and jason-capsule42 committed Sep 30, 2024
1 parent 89a5f20 commit f280e8f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions demo/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
|-----------------------------------|-----------------------------------|-----------|----------------------------|--------------------------------------------------|
| [activeLabel](#activeLabel) | `activeLabel` | `Boolean` | false | If set, the label will remain fixed in the active position. |
| [autocapitalize](#autocapitalize) | `autocapitalize` | `String` | | An enumerated attribute that controls whether and how text input is automatically capitalized as it is entered/edited by the user. [off/none, on/sentences, words, characters] |
| [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. |
| [autocorrect](#autocorrect) | `autocorrect` | `String` | | When set to `off`, stops iOS from auto correcting words when typed into a text box. |
| [customValidityTypeEmail](#customValidityTypeEmail) | `customValidityTypeEmail` | `string` | | |
| [disabled](#disabled) | `disabled` | `Boolean` | false | If set, disables the input. |
Expand Down
1 change: 1 addition & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
|-----------------------------------|-----------------------------------|-----------|----------------------------|--------------------------------------------------|
| `activeLabel` | `activeLabel` | `Boolean` | false | If set, the label will remain fixed in the active position. |
| `autocapitalize` | `autocapitalize` | `String` | | An enumerated attribute that controls whether and how text input is automatically capitalized as it is entered/edited by the user. [off/none, on/sentences, words, characters] |
| `autocomplete` | `autocomplete` | `String` | | An enumerated attribute that defines what the user agent can suggest for autofill. At this time, only `autocomplete="off"` is supported. |
| `autocorrect` | `autocorrect` | `String` | | When set to `off`, stops iOS from auto correcting words when typed into a text box. |
| `customValidityTypeEmail` | `customValidityTypeEmail` | `string` | | |
| `disabled` | `disabled` | `Boolean` | false | If set, disables the input. |
Expand Down
1 change: 1 addition & 0 deletions src/auro-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export class AuroInput extends BaseInput {
spellcheck="${ifDefined(this.spellcheck ? this.spellcheck : undefined)}"
autocorrect="${ifDefined(this.autocorrect ? this.autocorrect : undefined)}"
autocapitalize="${ifDefined(this.autocapitalize ? this.autocapitalize : undefined)}"
autocomplete="${ifDefined(this.autocomplete ? this.autocomplete : undefined)}"
part="input"
/>
</div>
Expand Down
5 changes: 5 additions & 0 deletions src/base-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import AuroFormValidation from '@aurodesignsystem/auro-formvalidation/src/valida
*
* @attr {Boolean} activeLabel - If set, the label will remain fixed in the active position.
* @attr {String} autocapitalize - An enumerated attribute that controls whether and how text input is automatically capitalized as it is entered/edited by the user. [off/none, on/sentences, words, characters]
* @attr {String} autocomplete - An enumerated attribute that defines what the user agent can suggest for autofill. At this time, only `autocomplete="off"` is supported.
* @attr {String} autocorrect - When set to `off`, stops iOS from auto correcting words when typed into a text box.
* @attr {Boolean} bordered - Applies bordered UI variant.
* @attr {Boolean} borderless - Applies borderless UI variant.
Expand Down Expand Up @@ -173,6 +174,10 @@ export default class BaseInput extends LitElement {
spellcheck: { type: String },
autocorrect: { type: String },
autocapitalize: { type: String },
autocomplete: {
type: String,
reflect: true
},
placeholder: { type: String },
activeLabel: {
type: Boolean,
Expand Down

0 comments on commit f280e8f

Please sign in to comment.