fix: same context menu appearing across views for same index items

This commit is contained in:
thecodrr
2020-04-26 14:12:45 +05:00
parent 02e4c0498d
commit ace4e06031
2 changed files with 2 additions and 3 deletions

View File

@@ -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);
}}

View File

@@ -27,7 +27,6 @@ function Colors(props) {
<Icon.Checkmark
sx={{
position: "absolute",
top: "4px",
left: "5px",
cursor: "pointer",
}}