Skip to content

Commit e6e76d5

Browse files
authored
fix(VOverlay): check for Shadow DOM on mount (#19947)
fixes #19943
1 parent 07a6fb8 commit e6e76d5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ export const VOverlay = genericComponent<OverlaySlots>()({
140140
if (!(v && props.disabled)) model.value = v
141141
},
142142
})
143-
const { teleportTarget } = useTeleport(computed(() => props.attach || props.contained))
144143
const { themeClasses } = provideTheme(props)
145144
const { rtlClasses, isRtl } = useRtl()
146145
const { hasContent, onAfterLeave: _onAfterLeave } = useLazy(props, isActive)
@@ -155,6 +154,9 @@ export const VOverlay = genericComponent<OverlaySlots>()({
155154
contentEvents,
156155
scrimEvents,
157156
} = useActivator(props, { isActive, isTop: localTop })
157+
const potentialShadowDomRoot = computed(() => (activatorEl?.value as Element)?.getRootNode() as Element)
158+
const { teleportTarget } = useTeleport(computed(() => props.attach || props.contained ||
159+
potentialShadowDomRoot.value instanceof ShadowRoot ? potentialShadowDomRoot.value : false))
158160
const { dimensionStyles } = useDimension(props)
159161
const isMounted = useHydration()
160162
const { scopeId } = useScopeId()

0 commit comments

Comments
 (0)