fix(selection): dont render selection when another node gets selected
This commit is contained in:
@@ -25,6 +25,7 @@ export default ({
|
||||
}: NodesSelectionProps) => {
|
||||
const [tX, tY, tScale] = useStoreState((state) => state.transform);
|
||||
const selectedNodesBbox = useStoreState((state) => state.selectedNodesBbox);
|
||||
const selectionActive = useStoreState((state) => state.selectionActive);
|
||||
const selectedElements = useStoreState((state) => state.selectedElements);
|
||||
const snapToGrid = useStoreState((state) => state.snapToGrid);
|
||||
const snapGrid = useStoreState((state) => state.snapGrid);
|
||||
@@ -34,10 +35,6 @@ export default ({
|
||||
|
||||
const grid = (snapToGrid ? snapGrid : [1, 1])! as [number, number];
|
||||
|
||||
if (!selectedElements) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const selectedNodes = useMemo(
|
||||
() =>
|
||||
selectedElements
|
||||
@@ -109,6 +106,10 @@ export default ({
|
||||
[selectedNodesBbox]
|
||||
);
|
||||
|
||||
if (!selectedElements || selectionActive) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="react-flow__nodesselection" style={style}>
|
||||
<ReactDraggable
|
||||
|
||||
Reference in New Issue
Block a user