vue3-otp-input
vue3-otp-input copied to clipboard
otpInput.value.clearInput() does not clear the very last num input field
I am using the otpInput as below:
<v-otp-input ref="otpInput" inputmode="numeric" separator="" :num-inputs="6" :should-auto-focus="false" :is-input-num="true" :placeholder="['', '', '', '', '', '']" @on-complete="handleOnComplete" />
But when I call otpInput.value.clearInput()
in the handleOnComplete()
it clears only the first 5 inputs but not the last one.
Not sure if I am doing something wrong or if this a something that happens:
Just want to be able to clear it in case the user needs a new code resent.
Also I am not finding how to programmatically focus the first input when required, tried otpInput.value.focus()
but it didn't work. Say when the OTP code has been sent to the user.
otpInput.value.focusInput(0)
goes to the 2nd input:
Is this an issue or working as expected? Any help appreciated.
@ejirocodes @AguilarTech
Is help still needed? Would love to contribute and resolve
@D-Lite sure. Please do
@D-Lite
yes please, still stuck on this, not sure how to fix
I have the exact same 2 issues and the package is not really useful for me with these bugs.
EDIT: I could actually fix both by putting v-if with a setTimeout on the component.
@vptill, @AguilarTech @D-Lite this has been fixed in the latest release