Skip to content

Commit fe1214f

Browse files
committed
fix(VMenu): ignore focus on root element
fixes #22263
1 parent 8e810e5 commit fe1214f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,14 @@ export const VMenu = genericComponent<OverlaySlots>()({
128128
if (
129129
isActive.value &&
130130
before !== after &&
131+
overlay.value?.rootEl &&
131132
overlay.value?.contentEl &&
132133
// We're the menu without open submenus or overlays
133134
overlay.value?.localTop &&
134135
// It isn't the document or the menu body
135-
![document, overlay.value.contentEl].includes(after!) &&
136+
![document, overlay.value.rootEl].includes(after!) &&
136137
// It isn't inside the menu body
137-
!overlay.value.contentEl.contains(after)
138+
!overlay.value.rootEl.contains(after)
138139
) {
139140
if (focusTrapSuppressed) {
140141
if (!props.openOnHover && !overlay.value.activatorEl?.contains(after)) {

packages/vuetify/src/components/VOverlay/VOverlay.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ export const VOverlay = genericComponent<OverlaySlots>()({
366366
target,
367367
animateClick,
368368
contentEl,
369+
rootEl: root,
369370
globalTop,
370371
localTop,
371372
updateLocation,

0 commit comments

Comments
 (0)