Skip to content

Commit 15baec9

Browse files
committed
implement tabIndex for input
1 parent f60c2f4 commit 15baec9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/uui-input/lib/uui-input.element.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,14 @@ export class UUIInputElement extends UUIFormControlMixin(
214214
@property({ type: String })
215215
pattern?: string;
216216

217+
/**
218+
* Set the input tabindex, set this to `-1` to avoid tabbing into the input.
219+
* @type {number}
220+
* @attr
221+
*/
222+
@property({ type: Number, reflect: false, attribute: 'tabindex' })
223+
tabIndex: number = 0;
224+
217225
@query('#input')
218226
_input!: HTMLInputElement;
219227

@@ -349,6 +357,7 @@ export class UUIInputElement extends UUIFormControlMixin(
349357
?autofocus=${this.autofocus}
350358
?required=${this.required}
351359
?readonly=${this.readonly}
360+
tabindex=${ifDefined(this.tabIndex)}
352361
@input=${this.onInput}
353362
@change=${this.onChange} />`;
354363
}

0 commit comments

Comments
 (0)