Skip to content

Commit

Permalink
fix(VDialog): don't try to focus tabindex="-1" or hidden inputs
Browse files Browse the repository at this point in the history
fixes #15745
  • Loading branch information
KaelWD committed Sep 8, 2022
1 parent 4468e3c commit 89e3850
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vuetify/src/components/VDialog/VDialog.ts
Expand Up @@ -234,8 +234,8 @@ export default baseMixins.extend({
// So we must have focused something outside the dialog and its children
) {
// 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
const focusable = this.$refs.dialog.querySelectorAll('button, [href], input:not([type="hidden"]), select, textarea, [tabindex]:not([tabindex="-1"])')
const el = [...focusable].find(el => !el.hasAttribute('disabled') && !el.matches('[tabindex="-1"]')) as HTMLElement | undefined
el && el.focus()
}
},
Expand Down

0 comments on commit 89e3850

Please sign in to comment.