34
34
this.$refs.code.dispatchEvent(new Event('input', { bubbles: true }));
35
35
this.$refs.code.dispatchEvent(new Event('change', { bubbles: true }));
36
36
},
37
- onComplete() {
38
- this.updateHiddenField();
39
- },
40
37
handleNumberKey(index, key) {
41
38
this.getInput(index).value = key;
42
39
46
43
47
44
$nextTick(() => {
48
45
this.updateHiddenField();
49
- if (index === this.totalDigits && this.isComplete()) {
50
- this.onComplete();
51
- }
52
46
});
53
47
},
54
48
handleBackspace(index) {
90
84
91
85
if (numericOnly.length >= this.totalDigits) {
92
86
this.updateHiddenField();
93
- this.onComplete();
94
87
}
95
88
},
96
89
clearAll() {
@@ -118,7 +111,7 @@ class="relative">
118
111
@keydown =" handleKeyDown({{ $x } } , $event)"
119
112
@focus =" $el.select()"
120
113
@input =" $el.value = $el.value.replace(/[^0-9]/g, '').slice(0, 1)"
121
- class =" flex h-10 w-10 items-center justify-center border border-zinc-300 bg-accent-foreground text-center text-sm font-medium text-accent-content transition-colors placeholder:text-zinc-500 focus:border-accent focus:border-2 focus:outline-none focus:relative focus:z-10 disabled:cursor-not-allowed disabled:opacity-50 dark:border-zinc-700 dark:focus:border-accent
114
+ class =" flex h-10 w-10 items-center justify-center border border-zinc-300 bg-accent-foreground text-center text-sm font-medium text-accent-content transition-colors focus:border-accent focus:border-2 focus:outline-none focus:relative focus:z-10 dark:border-zinc-700 dark:focus:border-accent
122
115
@if ($x == 1 ) rounded-l-md @endif
123
116
@if ($x == $digits ) rounded-r-md @endif
124
117
@if ($x > 1 ) -ml-px @endif "
@@ -129,7 +122,6 @@ class="flex h-10 w-10 items-center justify-center border border-zinc-300 bg-acce
129
122
<input
130
123
{{ $attributes -> except ([' digits' ]) } }
131
124
type =" hidden"
132
- class =" hidden"
133
125
x-ref =" code"
134
126
name =" {{ $name } }"
135
127
minlength =" {{ $digits } }"
0 commit comments