From 59a93b696a87638e1ee160829397723555c3311a Mon Sep 17 00:00:00 2001 From: kim Date: Tue, 22 Oct 2024 17:04:56 +0200 Subject: [PATCH] fix: clear selection on navigation --- src/components/item/FolderContent.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/item/FolderContent.tsx b/src/components/item/FolderContent.tsx index e9bf73b8b..cdc5a8055 100644 --- a/src/components/item/FolderContent.tsx +++ b/src/components/item/FolderContent.tsx @@ -1,3 +1,4 @@ +import { useEffect } from 'react'; import { useOutletContext } from 'react-router-dom'; import { Alert, Box, Stack, Typography } from '@mui/material'; @@ -67,6 +68,10 @@ const Content = ({ useSelectionContext(); const DragSelection = useDragSelection({ containerId: CONTAINER_ID }); + useEffect(() => { + clearSelection(); + }, [clearSelection, item.id]); + if (mode === ItemLayoutMode.Map) { return (