diff --git a/src/lib/PinInput.svelte b/src/lib/PinInput.svelte index 880109a..b0b58ae 100644 --- a/src/lib/PinInput.svelte +++ b/src/lib/PinInput.svelte @@ -1,6 +1,19 @@ - { - valid = e.detail.valid; - }} - bind:this={hiddenInput} -/> +
+ { + valid = e.detail.valid; + }} + bind:this={hiddenInput} + /> -{#if label} - -{/if} + {#if label} + + {/if} -
-
- {#each { length: length } as _, i} - = value.length && 'border-red-500!' - ]} - value={value[i] || ''} - {required} - maxlength="1" - onfocus={onfocusinput(i)} - onmousedown={onmousedown(i)} - onkeydown={onkeydowninput(i)} - bind:this={inputs[i]} - placeholder="0" - /> - {/each} +
+
+ {#each { length: length } as _, i} + = value.length && 'border-red-500!' + ]} + value={value[i] || ''} + {required} + maxlength="1" + onfocus={onfocusinput(i)} + onmousedown={onmousedown(i)} + onkeydown={onkeydowninput(i)} + bind:this={inputs[i]} + placeholder="0" + /> + {/each} +
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index ee2eacb..eaeaf56 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -98,7 +98,7 @@

Pin Input

- +