Skip to content

Commit 22c002a

Browse files
committed
fix: add ifDefined() to remove attributes if not defined
1 parent 8d5dc32 commit 22c002a

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

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

+3-5
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,6 @@ export class UUIInputElement extends FormControlMixin(
298298
* Validates the input based on the Regex pattern
299299
* @type {string}
300300
* @attr
301-
* @default undefined
302301
*/
303302
@property({ type: String })
304303
pattern?: string;
@@ -308,7 +307,6 @@ export class UUIInputElement extends FormControlMixin(
308307
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode|MDN} for further information
309308
* @type {string}
310309
* @attr
311-
* @default undefined
312310
*/
313311
@property({ type: String })
314312
inputmode?: string;
@@ -416,9 +414,9 @@ export class UUIInputElement extends FormControlMixin(
416414
step=${ifDefined(this.step)}
417415
spellcheck=${ifDefined(this.spellcheck)}
418416
autocomplete=${ifDefined(this.autocomplete as any)}
419-
placeholder=${this.placeholder}
420-
aria-label=${this.label}
421-
inputmode=${this.inputMode}
417+
placeholder=${ifDefined(this.placeholder)}
418+
aria-label=${ifDefined(this.label)}
419+
inputmode=${ifDefined(this.inputMode)}
422420
.disabled=${this.disabled}
423421
?autofocus=${this.autofocus}
424422
?required=${this.required}

0 commit comments

Comments
 (0)