diff --git a/packages/harmony/src/components/popup/Popup.tsx b/packages/harmony/src/components/popup/Popup.tsx index b9b0ca96e44..8e6344f92a4 100644 --- a/packages/harmony/src/components/popup/Popup.tsx +++ b/packages/harmony/src/components/popup/Popup.tsx @@ -55,17 +55,15 @@ const getComputedOrigins = ( let containerWidth, containerHeight if (containerRef && containerRef.current) { + const containerRect = containerRef.current.getBoundingClientRect() containerWidth = - containerRef.current.getBoundingClientRect().width - - CONTAINER_INSET_PADDING + containerRect.width + containerRect.x - CONTAINER_INSET_PADDING containerHeight = - containerRef.current.getBoundingClientRect().height - - CONTAINER_INSET_PADDING + containerRect.height + containerRect.y - CONTAINER_INSET_PADDING } else { - containerWidth = - portal.getBoundingClientRect().width - CONTAINER_INSET_PADDING - containerHeight = - portal.getBoundingClientRect().height - CONTAINER_INSET_PADDING + const portalRect = portal.getBoundingClientRect() + containerWidth = portalRect.width + portalRect.x - CONTAINER_INSET_PADDING + containerHeight = portalRect.height + portalRect.y - CONTAINER_INSET_PADDING } // Get new wrapper position diff --git a/packages/web/src/components/menu/Menu.tsx b/packages/web/src/components/menu/Menu.tsx index 79d9f66f698..d98d40d25c4 100644 --- a/packages/web/src/components/menu/Menu.tsx +++ b/packages/web/src/components/menu/Menu.tsx @@ -31,6 +31,7 @@ const Menu = forwardRef((props, ref) => { items={items} onClose={onClose} anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }} + transformOrigin={{ vertical: 'top', horizontal: 'left' }} ref={ref} renderTrigger={children} zIndex={zIndex}