Skip to content

Commit

Permalink
fix: create context menus out of screen
Browse files Browse the repository at this point in the history
  • Loading branch information
wuzi committed Jul 18, 2021
1 parent 92288c7 commit 7ce83c0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/ContextMenu/ContextMenuList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ export const ContextMenuList: React.FC<Props & MotionBoxProps> = ({
// where should the menu be shown?
// the ContextMenuTrigger sets this
const [position, setPosition] = useState<Position>({
left: 0,
left: -100,
right: 0,
top: 0,
top: -100,
bottom: 0,
});

Expand Down Expand Up @@ -122,6 +122,10 @@ export const ContextMenuList: React.FC<Props & MotionBoxProps> = ({
setContextMenusState((oldState) => {
return {
...oldState,
position: {
x: -100,
y: -100,
},
menus: oldState.menus.map((m) => ({
...m,
isOpen: false,
Expand Down

0 comments on commit 7ce83c0

Please sign in to comment.