Clear selection when changing maps
This commit is contained in:
parent
5546bf525e
commit
b3fc7f9e1d
@ -32,6 +32,7 @@ function useMapSelection(
|
||||
|
||||
const active = selectedToolId === "select";
|
||||
|
||||
// Remove selection when changing tools
|
||||
useEffect(() => {
|
||||
if (!active) {
|
||||
setSelection(null);
|
||||
@ -39,6 +40,12 @@ function useMapSelection(
|
||||
}
|
||||
}, [active]);
|
||||
|
||||
// Remove selection when changing maps
|
||||
useEffect(() => {
|
||||
setSelection(null);
|
||||
setIsSelectionMenuOpen(false);
|
||||
}, [map]);
|
||||
|
||||
function handleSelectionDragStart() {
|
||||
setIsSelectionDragging(true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user