Skip to content

Commit 056ff7c

Browse files
committed
feat(input): add input types
add the following input types: email, url, tel, search
1 parent b02205d commit 056ff7c

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

src/input/ux-input.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
<template role="textbox">
22
<require from="./ux-input-theme"></require>
33

4-
<input styles.input
5-
ref="textbox"
6-
value.bind="value"
7-
type.bind="type" />
4+
<input styles.input ref="textbox" value.bind="value" />
85

96
</template>

src/input/ux-input.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,16 @@ export class UxInput implements Themable {
6767
}
6868
}
6969

70-
if (this.type) {
71-
if (this.type !== 'text' && this.type !== 'password' && this.type !== 'number') {
72-
this.type = 'text';
73-
}
70+
if ([
71+
'text',
72+
'password',
73+
'number',
74+
'email',
75+
'url',
76+
'tel',
77+
'search'
78+
].includes(this.type)) {
79+
this.textbox.setAttribute('type', this.type);
7480
}
7581

7682
if (this.min) {

0 commit comments

Comments
 (0)