Skip to content

Commit 30ac0fc

Browse files
authored
fix(VMenu): let persistent menus coexist with regular ones (#21449)
resolves #20976
1 parent 8ea20d9 commit 30ac0fc

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

packages/api-generator/src/locale/en/VMenu.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"closeOnClick": "Designates if menu should close on outside-activator click.",
66
"closeOnContentClick": "Designates if menu should close when its content is clicked.",
77
"closeDelay": "Milliseconds to wait before closing component. Only works with the **open-on-hover** prop.",
8+
"disableInitialFocus": "Prevents automatic redirect of first `focusin` event. Intended to use on permanently open menus or VSpeedDial.",
89
"disableKeys": "Removes all keyboard interaction.",
910
"internalActivator": "Detaches the menu content inside of the component as opposed to the document.",
1011
"minWidth": "Sets the minimum width for the component. Use `auto` to use the activator width.",

packages/vuetify/src/components/VMenu/VMenu.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export const makeVMenuProps = propsFactory({
4848
// disableKeys: Boolean,
4949
id: String,
5050
submenu: Boolean,
51+
disableInitialFocus: Boolean,
5152

5253
...omit(makeVOverlayProps({
5354
closeDelay: 250,
@@ -133,7 +134,7 @@ export const VMenu = genericComponent<OverlaySlots>()({
133134
watch(isActive, val => {
134135
if (val) {
135136
parent?.register()
136-
if (IN_BROWSER) {
137+
if (IN_BROWSER && !props.disableInitialFocus) {
137138
document.addEventListener('focusin', onFocusIn, { once: true })
138139
}
139140
} else {

0 commit comments

Comments
 (0)