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