Skip to content

Commit 89e3850

Browse files
committed
fix(VDialog): don't try to focus tabindex="-1" or hidden inputs
fixes #15745
1 parent 4468e3c commit 89e3850

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/vuetify/src/components/VDialog/VDialog.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,8 @@ export default baseMixins.extend({
234234
// So we must have focused something outside the dialog and its children
235235
) {
236236
// Find and focus the first available element inside the dialog
237-
const focusable = this.$refs.dialog.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')
238-
const el = [...focusable].find(el => !el.hasAttribute('disabled')) as HTMLElement | undefined
237+
const focusable = this.$refs.dialog.querySelectorAll('button, [href], input:not([type="hidden"]), select, textarea, [tabindex]:not([tabindex="-1"])')
238+
const el = [...focusable].find(el => !el.hasAttribute('disabled') && !el.matches('[tabindex="-1"]')) as HTMLElement | undefined
239239
el && el.focus()
240240
}
241241
},

0 commit comments

Comments
 (0)