Merge pull request #5592 from svilen-ivanov-kubit/svilen-ivanov-kubit-patch-1

Avoid modifying `node.measured` object, create copy instead
This commit is contained in:
Moritz Klack
2025-11-25 13:03:27 +01:00
committed by GitHub
2 changed files with 8 additions and 3 deletions

View File

@@ -0,0 +1,5 @@
---
'@xyflow/react': patch
---
Always create a new measured object in apply changes.

View File

@@ -125,9 +125,9 @@ function applyChange(change: any, element: any): any {
case 'dimensions': {
if (typeof change.dimensions !== 'undefined') {
element.measured ??= {};
element.measured.width = change.dimensions.width;
element.measured.height = change.dimensions.height;
element.measured = {
...change.dimensions,
};
if (change.setAttributes) {
if (change.setAttributes === true || change.setAttributes === 'width') {