Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report][2.6.0] v-otp-input : the component does not update the value correctly #14437

Closed
TheoPez opened this issue Nov 25, 2021 · 2 comments · Fixed by #14460
Closed

[Bug Report][2.6.0] v-otp-input : the component does not update the value correctly #14437

TheoPez opened this issue Nov 25, 2021 · 2 comments · Fixed by #14460
Labels
C: VOtpInput VOtpInput T: bug Functionality that does not work as intended/expected
Milestone

Comments

@TheoPez
Copy link
Contributor

TheoPez commented Nov 25, 2021

Environment

Vuetify Version: 2.6.0
Vue Version: 2.6.11
Browsers: Firefox 95.0
OS: Linux x86_64

Steps to reproduce

Type an otp code and press the "Reset Form" button.
As you can see, the otpValue becomes null, but the otp field does not update.

Expected Behavior

We expect the field to be updated

Actual Behavior

The v-otp-input field is not updated

Reproduction Link

https://codepen.io/the0pe/pen/vYJoYJb

Other comments

I did some research on this problem, and found a clue.
Currently, when clearing, the otp value (declared on https://github.com/vuetifyjs/vuetify/blob/master/packages/vuetify/src/components/VOtpInput/VOtpInput.ts#L55) is not updated.

TheoPez added a commit to TheoPez/vuetify that referenced this issue Nov 25, 2021
@KaelWD KaelWD added T: bug Functionality that does not work as intended/expected C: VOtpInput VOtpInput and removed S: triage labels Nov 30, 2021
@ndmgrphc
Copy link

I love that this component was included in Vuetify. My solution to this issue in the meantime was to just include a :key="otpvs-${otpIncrement}" on the v-otp-input element and then bump up this.otpIncrement++ when I needed to redraw the input (like when the user entered the code wrong).

@mathiasconradt
Copy link

mathiasconradt commented Dec 21, 2021

I found a related issue here (I'm on 2.6.1), you can also test it in the above mentioned Codepen.

Instead of typing the character into the OTP fields one by one, copy/paste an entire 6-digit string into the first OTP-field. The printed out value below does not update.

My issue should probably go into a different bug report, but just wanted to mention it here, because this issue title is a bit misleading, it sounds like the other way around than in the description.

IMO this bug title should be: "v-otp-input : the value/model does not update the component" instead of "v-otp-input : the component does not update the value correctly"... which is actually what my problem is. Which is why I found this issue report here when googling for my problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VOtpInput VOtpInput T: bug Functionality that does not work as intended/expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants