diff --git a/packages/vuetify/src/components/VOverlay/VOverlay.tsx b/packages/vuetify/src/components/VOverlay/VOverlay.tsx index 75da73ed33b..97e6460a56b 100644 --- a/packages/vuetify/src/components/VOverlay/VOverlay.tsx +++ b/packages/vuetify/src/components/VOverlay/VOverlay.tsx @@ -140,7 +140,6 @@ export const VOverlay = genericComponent()({ if (!(v && props.disabled)) model.value = v }, }) - const { teleportTarget } = useTeleport(computed(() => props.attach || props.contained)) const { themeClasses } = provideTheme(props) const { rtlClasses, isRtl } = useRtl() const { hasContent, onAfterLeave: _onAfterLeave } = useLazy(props, isActive) @@ -155,6 +154,9 @@ export const VOverlay = genericComponent()({ contentEvents, scrimEvents, } = useActivator(props, { isActive, isTop: localTop }) + const potentialShadowDomRoot = computed(() => (activatorEl?.value as Element)?.getRootNode() as Element) + const { teleportTarget } = useTeleport(computed(() => props.attach || props.contained || + potentialShadowDomRoot.value instanceof ShadowRoot ? potentialShadowDomRoot.value : false)) const { dimensionStyles } = useDimension(props) const isMounted = useHydration() const { scopeId } = useScopeId()