diff --git a/docs/getting-started/changelog.md b/docs/getting-started/changelog.md index 40e69ae9..8fcf5dfa 100644 --- a/docs/getting-started/changelog.md +++ b/docs/getting-started/changelog.md @@ -10,8 +10,10 @@ _During the beta period, these restrictions may be relaxed in the event of a mis - Added `sl-clear` event to `sl-select` - Fixed a bug where dynamically changing menu items in `sl-select` would cause the display label to be blank [#374](https://github.com/shoelace-style/shoelace/discussions/374) -- Fixed the margin in `sl-menu-label` to align with menu items - Fixed a bug where setting the `value` attribute or property on `sl-input` and `sl-textarea` would trigger validation too soon +- Fixed the margin in `sl-menu-label` to align with menu items +- Fixed `autofocus` attributes in `sl-input` and `sl-textarea` +- Improved types for `autocapitalize` in `sl-input` and `sl-textarea` ## 2.0.0-beta.33 diff --git a/src/components/input/input.ts b/src/components/input/input.ts index c9fa6823..9ab64324 100644 --- a/src/components/input/input.ts +++ b/src/components/input/input.ts @@ -111,7 +111,7 @@ export default class SlInput extends LitElement { @property({ type: Boolean, reflect: true }) invalid = false; /** The input's autocaptialize attribute. */ - @property() autocapitalize: string; + @property() autocapitalize: 'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters'; /** The input's autocorrect attribute. */ @property() autocorrect: string; @@ -315,7 +315,7 @@ export default class SlInput extends LitElement { autocapitalize=${ifDefined(this.autocapitalize)} autocomplete=${ifDefined(this.autocomplete)} autocorrect=${ifDefined(this.autocorrect)} - autofocus=${ifDefined(this.autofocus)} + ?autofocus=${this.autofocus} spellcheck=${ifDefined(this.spellcheck)} pattern=${ifDefined(this.pattern)} inputmode=${ifDefined(this.inputmode)} diff --git a/src/components/textarea/textarea.ts b/src/components/textarea/textarea.ts index a3c25433..d93ee957 100644 --- a/src/components/textarea/textarea.ts +++ b/src/components/textarea/textarea.ts @@ -85,7 +85,19 @@ export default class SlTextarea extends LitElement { @property({ type: Boolean, reflect: true }) invalid = false; /** The textarea's autocaptialize attribute. */ - @property() autocapitalize: string; + @property() autocapitalize: + | 'off' + | 'none' + | 'on' + | 'sentences' + | 'words' + | 'characters' + | 'off' + | 'none' + | 'on' + | 'sentences' + | 'words' + | 'characters'; /** The textarea's autocorrect attribute. */ @property() autocorrect: string; @@ -283,7 +295,7 @@ export default class SlTextarea extends LitElement { maxlength=${ifDefined(this.maxlength)} autocapitalize=${ifDefined(this.autocapitalize)} autocorrect=${ifDefined(this.autocorrect)} - autofocus=${ifDefined(this.autofocus)} + ?autofocus=${this.autofocus} spellcheck=${ifDefined(this.spellcheck)} inputmode=${ifDefined(this.inputmode)} aria-labelledby=${this.labelId}