Skip to content

Commit c922c70

Browse files
added use:typeAction instead of binding type in Input.svelte
1 parent f5ed56f commit c922c70

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/svelte-ux/src/lib/components/Input.svelte

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@
4040
$: firstPlaceholderPos = [...(mask ?? '')].findIndex((c) => replaceSet.has(c));
4141
$: acceptRegEx = accept instanceof RegExp ? accept : new RegExp(accept, 'g');
4242
43+
function typeAction(node: HTMLInputElement) {
44+
node.type = type;
45+
}
46+
4347
function clean(inputValue: string) {
4448
// Get only accepted characters (no mask)
4549
const inputMatch = inputValue?.match(acceptRegEx) || [];
@@ -93,7 +97,7 @@
9397
<input
9498
{id}
9599
{value}
96-
{type}
100+
use:typeAction
97101
{inputmode}
98102
placeholder={isFocused && mask ? mask : placeholder}
99103
{disabled}

0 commit comments

Comments
 (0)