Skip to content

Commit d4dc1c7

Browse files
committed
Simplify type and inputmode
1 parent 74ddddf commit d4dc1c7

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

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

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,8 @@ export class UUIInputElement extends UUIFormControlMixin(
183183
* @attr
184184
* @default text
185185
*/
186-
@property({ type: String })
187-
get type(): InputType {
188-
return this._type;
189-
}
190-
set type(value: InputType) {
191-
this._type = value;
192-
}
186+
@property({ attribute: 'type' })
187+
type: InputType = 'text';
193188

194189
/**
195190
* The inputmode global attribute is an enumerated attribute that hints at the type of data that might be entered by the user while editing the element or its contents. This allows a browser to display an appropriate virtual keyboard.
@@ -198,13 +193,8 @@ export class UUIInputElement extends UUIFormControlMixin(
198193
* @attr
199194
* @default text
200195
*/
201-
@property({ type: String })
202-
get inputMode(): InputMode {
203-
return this._inputMode;
204-
}
205-
set inputMode(value: InputMode) {
206-
this._inputMode = value;
207-
}
196+
@property({ attribute: 'inputmode' })
197+
inputMode: InputMode = 'text';
208198

209199
/**
210200
* Validates the input based on the Regex pattern
@@ -217,9 +207,6 @@ export class UUIInputElement extends UUIFormControlMixin(
217207
@query('#input')
218208
_input!: HTMLInputElement;
219209

220-
private _type: InputType = 'text';
221-
private _inputMode: InputMode = 'text';
222-
223210
constructor() {
224211
super();
225212

0 commit comments

Comments
 (0)