[Bug Report][3.3.21] TextField autofocus not working inside vDialog
Environment
Vuetify Version: 3.3.21 Vue Version: 3.3.4 Browsers: Chrome 117.0.0.0 OS: Mac OS 10.15.7
Steps to reproduce
- Create a dialog
- Add a text-field with autofocus enabled
Expected Behavior
Focusing into the input field after opening the dialog.
Actual Behavior
When using an input field inside a dialog the autofocus prop doesn't work.
Reproduction Link
https://play.vuetifyjs.com/#...
Other comments
As discussed with Kael this is supposed to work
issue still happens with vuetify 3.4.8
It works for me in this environment: Vuetify Version: 3.5.12 Vue Version: 3.4.21 Browsers: Chrome 123.0.0.0 OS: Windows 10
@Dominic-Marcelino and @agentschmitt is it still actual for you?
It works for me in this environment: Vuetify Version: 3.5.12 Vue Version: 3.4.21 Browsers: Chrome 123.0.0.0 OS: Windows 10
@Dominic-Marcelino and @agentschmitt is it still actual for you?
Still not working for me using the given reproduction above (With the latest vuetify and vue version)
Vuetify 3.5.13 Vue: 3.4.21 Chrome: 123.0.6312.58 OS: Mac.
It works for me in this environment: Vuetify Version: 3.5.12 Vue Version: 3.4.21 Browsers: Chrome 123.0.0.0 OS: Windows 10 @Dominic-Marcelino and @agentschmitt is it still actual for you?
Still not working for me using the given reproduction above (With the latest vuetify and vue version)
Vuetify 3.5.13 Vue: 3.4.21 Chrome: 123.0.6312.58 OS: Mac.
Yes, I can reproduce it in BrowserStack only in Chrome on Mac OS.
The reproduction above fails here as well, while it works without transition:
<v-dialog activator="parent" :transition="false">
Vuetify Version: 3.7.2 Vue Version: 3.5.12 Browsers:
- Firefox 131.0.3
- Safari 17.6
- Chrome 129.0.6668.91
OS: Mac OS 14.6.1
Is it only reproducible on Mac and iOS? Disabling transition helps on iOS as well, but does not actually show the keyboard. My current hypothesis is that iOS Safari will only show keyboard if triggered by the user and Vuetify somehow breaks that chain.
The issue is still their in latest version. Also its not only in iOS Safari. But it works with :transition=false as mentioned by @bovesan
Vuetify 3.7.15 Vue 3.5.13 Browsers:
- Chrome 134.0.6998.36 (Windows 11)
- Firefox 136.0 (Windows 11)
The exact same problem is happening with VMenu too.
https://play.vuetifyjs.com/#eNptUsFOAyEQ/ZWRS23S3Y3WU7M1mhjjzaMH1wOybENkgcCwMWn67w5s7XabnmDeezweM3zuWfCienauHKJkG1aj7J3mKB8bA1APBXcub3MhrEGujPRHKIPfaE4lwLuTBl4U13Y3gaTqpYnABaqBo/XbhjnupcGGwUZoG2RhTbYnrBBaiR+SdFwH2bAz9zEF9+0MO6EFyl+8oDKZ8KJTUrdAUWwrNdn3YZeu5xFtZ0UMBKGPdCF42VGhjIv4mg4RVF2zpafD0ylt8qC0ea2ry8bkI4Rez/nPnIEJSl2bej3zzCdm80jIOK66OhsjlUF45RCCxDhOU/XOeoR9eikcoPO2hwX9gEWSA5BvQKD+wDYpbhdvUmsLH9br9maxnCRTi45K4hLbRUOjtgZyM26XsB9DT/py4DrK8sgn9pByj0kpIzus2Lpclw9sXO/v2Cr/h9Xsx47Y1x+VDNsF
setTimeout(() => target?.focus(), 50) seems to be the most reliable when applied here:
https://github.com/vuetifyjs/vuetify/blob/9723468770edca197876b567f67f64159968e58e/packages/vuetify/src/composables/autofocus.ts#L5-L15