From ace4e0603119456e9aa1ff3beb969fb73f53428a Mon Sep 17 00:00:00 2001 From: thecodrr Date: Sun, 26 Apr 2020 14:12:45 +0500 Subject: [PATCH] fix: same context menu appearing across views for same index items --- apps/web/src/components/list-item/index.js | 4 ++-- apps/web/src/components/menu/colors.js | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/web/src/components/list-item/index.js b/apps/web/src/components/list-item/index.js index 786a9db4c..769494139 100644 --- a/apps/web/src/components/list-item/index.js +++ b/apps/web/src/components/list-item/index.js @@ -42,7 +42,7 @@ const ItemSelector = ({ isSelected, toggleSelection }) => { }; function ListItem(props) { - const menuId = `contextMenu${props.index}`; + const menuId = `contextMenu-${props.item.id}`; const [parentRef, closeMenu, openMenu] = useContextMenu(menuId); const isSelectionMode = useSelectionStore((store) => store.isSelectionMode); const selectedItems = useSelectionStore((store) => store.selectedItems); @@ -185,7 +185,7 @@ function ListItem(props) { size={22} strokeWidth={2} color="icon" - style={{ marginRight: -5 }} + sx={{ marginRight: -1 }} onClick={(e) => { openMenu(e.nativeEvent, menuId, true); }} diff --git a/apps/web/src/components/menu/colors.js b/apps/web/src/components/menu/colors.js index 203d92dcf..2b73aa913 100644 --- a/apps/web/src/components/menu/colors.js +++ b/apps/web/src/components/menu/colors.js @@ -27,7 +27,6 @@ function Colors(props) {