fix(react): expandParent option for child nodes
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
- do not use fallback handle if a specific id is being used
|
||||
- fix `defaultEdgeOptions` markers not being applied
|
||||
- fix `getNodesBounds` and add second param for passing options
|
||||
- fix `expandParent` for child nodes
|
||||
|
||||
## 12.0.0-next.7
|
||||
|
||||
|
||||
@@ -6,10 +6,7 @@ export function handleParentExpand(updatedElements: any[], updateItem: any) {
|
||||
for (const [index, item] of updatedElements.entries()) {
|
||||
if (item.id === updateItem.parentNode) {
|
||||
const parent = { ...item };
|
||||
|
||||
if (!parent.computed) {
|
||||
parent.computed = {};
|
||||
}
|
||||
parent.computed ??= {};
|
||||
|
||||
const extendWidth = updateItem.position.x + updateItem.computed.width - parent.computed.width;
|
||||
const extendHeight = updateItem.position.y + updateItem.computed.height - parent.computed.height;
|
||||
@@ -106,7 +103,7 @@ function applyChanges(changes: any[], elements: any[]): any[] {
|
||||
const updatedElement = { ...element };
|
||||
|
||||
for (const change of changes) {
|
||||
applyChange(change, updatedElement, elements);
|
||||
applyChange(change, updatedElement, updatedElements);
|
||||
}
|
||||
|
||||
updatedElements.push(updatedElement);
|
||||
|
||||
Reference in New Issue
Block a user