Merge pull request #5213 from xyflow/refactor/selection-events
Refactor/selection events
This commit is contained in:
5
.changeset/perfect-ravens-brush.md
Normal file
5
.changeset/perfect-ravens-brush.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@xyflow/react': patch
|
||||
---
|
||||
|
||||
Do not trigger selection events if elementsSelectable=false
|
||||
@@ -19,13 +19,13 @@ const selector = (s: ReactFlowState) => {
|
||||
const selectedEdges = [];
|
||||
|
||||
for (const [, node] of s.nodeLookup) {
|
||||
if (node.selected) {
|
||||
if (node.selected && (s.elementsSelectable || node.selectable)) {
|
||||
selectedNodes.push(node.internals.userNode);
|
||||
}
|
||||
}
|
||||
|
||||
for (const [, edge] of s.edgeLookup) {
|
||||
if (edge.selected) {
|
||||
if (edge.selected && (s.elementsSelectable || edge.selectable)) {
|
||||
selectedEdges.push(edge);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user