Skip to content

Commit

Permalink
Merge pull request #1988 from Sec-ant/patch
Browse files Browse the repository at this point in the history
fix multiSelection when selectNodesOnDrag is false
  • Loading branch information
moklick committed Mar 23, 2022
2 parents b0bec16 + 5902626 commit 859571d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/Nodes/wrapNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,13 @@ export default (NodeComponent: ComponentType<NodeProps>) => {
addSelectedNodes([id]);
}
} else if (!selectNodesOnDrag && !selected && isSelectable) {
unselectNodesAndEdges();
store.setState({ nodesSelectionActive: false });
const { multiSelectionActive } = store.getState();
if (multiSelectionActive) {
addSelectedNodes([id]);
} else {
unselectNodesAndEdges();
store.setState({ nodesSelectionActive: false });
}
}

if (onNodeDragStart) {
Expand Down

0 comments on commit 859571d

Please sign in to comment.