Merge pull request #4465 from xyflow/fix/measured-bug

Fix/measured bug
This commit is contained in:
Moritz Klack
2024-07-18 13:14:30 +02:00
committed by GitHub
2 changed files with 7 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@xyflow/system': patch
---
fix(nodes): re-measure when measured is not set
+2 -1
View File
@@ -80,7 +80,8 @@ export function adoptUserNodes<NodeType extends NodeBase>(
},
internals: {
positionAbsolute: getNodePositionWithOrigin(userNode, _options.nodeOrigin),
handleBounds: internalNode?.internals.handleBounds,
// if user re-initializes the node or removes `measured` for whatever reason, we reset the handleBounds so that the node gets re-measured
handleBounds: !userNode.measured ? undefined : internalNode?.internals.handleBounds,
z: calculateZ(userNode, selectedNodeZ),
userNode,
},