Skip to content

Commit

Permalink
Bring back item menu
Browse files Browse the repository at this point in the history
  • Loading branch information
mgmeyers committed Apr 16, 2024
1 parent 9b0a694 commit fb338e0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/components/Item/Item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ const ItemInner = memo(function ItemInner({
path,
});

const onContextMenu: JSX.MouseEventHandler<HTMLDivElement> = useCallback(
(e) => {
if (isEditing(editState)) return;
showItemMenu(e);
},
[showItemMenu, editState]
);

const onDoubleClick: JSX.MouseEventHandler<HTMLDivElement> = useCallback(
(e) => setEditState({ x: e.clientX, y: e.clientY }),
[setEditState]
Expand All @@ -99,6 +107,7 @@ const ItemInner = memo(function ItemInner({
<div
// eslint-disable-next-line react/no-unknown-property
onDblClick={onDoubleClick}
onContextMenu={onContextMenu}
className={c('item-content-wrapper')}
{...ignoreAttr}
>
Expand Down

0 comments on commit fb338e0

Please sign in to comment.