Skip to content

Commit

Permalink
Fix confirm menu position
Browse files Browse the repository at this point in the history
  • Loading branch information
alexisfontaine committed Dec 21, 2021
1 parent 13dace9 commit bf2f354
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/ConfirmMenu/ConfirmMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ export const ConfirmMenu = React.forwardRef<HTMLDivElement, ConfirmMenuProps>(
}

const styleSetter = React.useCallback<TogglePanelStyleSetter>(
(_, triggerDimensions) => {
const top = triggerDimensions.bottom + 8

return position === 'right'
? { top, right: triggerDimensions.right }
: { top, left: triggerDimensions.left }
},
(dimensions, triggerDimensions) => ({
left:
position === 'right'
? triggerDimensions.right - dimensions.width
: triggerDimensions.left,
top: triggerDimensions.bottom + 8,
}),
[position]
)

Expand Down

0 comments on commit bf2f354

Please sign in to comment.