Environment
Vuetify Version: 2.6.9
Vue Version: 2.7.10
Browsers: Chrome 105.0.0.0
OS: Mac OS 10.15.7
Steps to reproduce
Place any <input type="hidden"> inside a <v-dialog>.
Expected Behavior
Focus is trapped within dialog.
Actual Behavior
Focus trap breaks and background elements are focusable.
Reproduction Link
https://codepen.io/shengslogar/pen/oNdjWNo
Other comments
This is the result of the query selector here:
|
// Find and focus the first available element inside the dialog |
|
const focusable = this.$refs.dialog.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])') |
|
const el = [...focusable].find(el => !el.hasAttribute('disabled')) as HTMLElement | undefined |
|
el && el.focus() |
At a bare minimum, hidden inputs should be excluded from this selector. One might also consider aria-hidden inputs or display: none inputs (but the latter would require computing element dimensions which could result in a breaking change).
Environment
Vuetify Version: 2.6.9
Vue Version: 2.7.10
Browsers: Chrome 105.0.0.0
OS: Mac OS 10.15.7
Steps to reproduce
Place any
<input type="hidden">inside a<v-dialog>.Expected Behavior
Focus is trapped within dialog.
Actual Behavior
Focus trap breaks and background elements are focusable.
Reproduction Link
https://codepen.io/shengslogar/pen/oNdjWNo
Other comments
This is the result of the query selector here:
vuetify/packages/vuetify/src/components/VDialog/VDialog.ts
Lines 236 to 239 in ac45c98
At a bare minimum, hidden inputs should be excluded from this selector. One might also consider
aria-hiddeninputs ordisplay: noneinputs (but the latter would require computing element dimensions which could result in a breaking change).