Avoid modifying node.measured object, create copy instead

When working with immutable `node` data, modifying in-place `node.measured` properties is not allowed. Since we perform a shallow copy, we need to create a new `measured` object to populate `width` and `height`
This commit is contained in:
Svilen Ivanov
2025-10-30 16:04:40 +02:00
committed by GitHub
parent 905ab996f5
commit f739c7fae1

View File

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