revert change on the menu primitives

This commit is contained in:
lebaudantoine
2026-05-07 11:37:06 +02:00
parent 435990f589
commit 1936c692b2
+15 -15
View File
@@ -22,29 +22,29 @@ export const Menu = ({
placement?: 'bottom' | 'top' | 'left' | 'right'
}) => {
const [trigger, menu] = children
const boundaryElement = useOverlayBoundaryElement()
const portalContainer = useOverlayPortalContainer()
// const boundaryElement = useOverlayBoundaryElement()
// const portalContainer = useOverlayPortalContainer()
// Detect if we're in PiP: portal container is in a different document than the main window
const isInPiP = useMemo(
() =>
portalContainer &&
portalContainer.ownerDocument &&
portalContainer.ownerDocument !== document,
[portalContainer]
)
// // Detect if we're in PiP: portal container is in a different document than the main window
// const isInPiP = useMemo(
// () =>
// portalContainer &&
// portalContainer.ownerDocument &&
// portalContainer.ownerDocument !== document,
// [portalContainer]
// )
// Default placement: 'bottom' in PiP, 'top' elsewhere (to match existing behavior)
const defaultPlacement = isInPiP ? 'bottom' : 'top'
const shouldFlip = isInPiP ? false : undefined
// const defaultPlacement = isInPiP ? 'bottom' : 'top'
// const shouldFlip = isInPiP ? false : undefined
return (
<MenuTrigger>
{trigger}
<StyledPopover
placement={placement ?? defaultPlacement}
shouldFlip={shouldFlip}
boundaryElement={boundaryElement}
placement={placement}
// shouldFlip={shouldFlip}
// boundaryElement={boundaryElement}
>
<Box size="sm" type="popover" variant={variant}>
{menu}