vuetifyjs / vuetify

🐉 Vue Component Framework
https://vuetifyjs.com
MIT License
39.79k stars 6.96k forks source link

[Feature Request] Way to programmatically reset and focus VOtpInput #19589

Open greggarson opened 6 months ago

greggarson commented 6 months ago

Problem to solve

autofocus works great for focusing the first input on pageload. I am however not seeing a way to achieve the same behavior programmatically after a form submission etc. I've tried setting a ref on the otp and calling focus() on that but it doesn't appear to have the expected effect of emulating what autofocus does.

Relatively new to vue and vuetify so may be missing something simple. Does this functionality already exist?

Proposed solution

Have .focus() emulate the behavior of the autofocus prop or add an additional function that does so.

b-maslennikov commented 6 months ago

can you provide the code that replicates your problem? I'm able to focus it anytime https://play.vuetifyjs.com/#...

greggarson commented 6 months ago

@b-maslennikov Thanks, good to know this should work. I'll put together a failing case.