Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions packages/harmony/src/components/popup/Popup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions packages/web/src/components/menu/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const Menu = forwardRef<HTMLDivElement, MenuProps>((props, ref) => {
items={items}
onClose={onClose}
anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }}
transformOrigin={{ vertical: 'top', horizontal: 'left' }}
ref={ref}
renderTrigger={children}
zIndex={zIndex}
Expand Down