Skip to content

[Bug Report][3.8.1] v-otp-input loses focus after token is pasted #21275

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

Open
Icebreaker83 opened this issue Apr 16, 2025 · 2 comments
Open

[Bug Report][3.8.1] v-otp-input loses focus after token is pasted #21275

Icebreaker83 opened this issue Apr 16, 2025 · 2 comments

Comments

@Icebreaker83
Copy link

Environment

Vuetify Version: 3.8.1
Vue Version: 3.5.13
Browsers: Chrome 135.0.0.0
OS: Windows 10

Steps to reproduce

Copy/paste some token into otp input

Expected Behavior

otp input doesn't lose focus and form can be submited

Actual Behavior

otp input loses focus after token is pasted, and form can't be submitted.

Reproduction Link

https://play.vuetifyjs.com/#...

Other comments

Behavior is caused by line

@jcjp
Copy link
Contributor

jcjp commented Apr 19, 2025

Maybe we could add an option to stop it from losing focus on copy paste, as per our documentation it is intended to lose focus after paste.

@jcjp jcjp self-assigned this Apr 19, 2025
@Icebreaker83
Copy link
Author

@jcjp There is simmilar issue but for manual entry, and blur was removed.
Most common usecase is to have v-otp-input inside a form that is submited on Enter, where user copy/pastes the token.

I personally would remove blur completely, and if blur is needed you can always handle that in finish event, although I can't imagine a single scenario where blur is needed.

My workaround is to refocus the component on finish event

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants