From 4644af5736a5b928fe538439cd5c0bb26adcff19 Mon Sep 17 00:00:00 2001 From: Braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Thu, 24 Mar 2022 20:23:22 +0100 Subject: [PATCH] fix(nodes): expand nodes correctly when prop enabled --- examples/Nesting/Nesting.vue | 20 +++++++++++++++---- src/utils/changes.ts | 37 ++++++++++++++++++++++++++++-------- 2 files changed, 45 insertions(+), 12 deletions(-) diff --git a/examples/Nesting/Nesting.vue b/examples/Nesting/Nesting.vue index 9686af9a..86543240 100644 --- a/examples/Nesting/Nesting.vue +++ b/examples/Nesting/Nesting.vue @@ -74,10 +74,22 @@ const { onConnect, nodes, edges, addEdges, addNodes } = useVueFlow({ onConnect((params) => addEdges([params])) onMounted(() => { - // dynamically add nodes to parent - addNodes([{ id: '999', type: 'input', label: 'Node 1', position: { x: 20, y: 100 }, class: 'light', extent: 'parent' }], { - parentNode: '2', - }) + // add nodes to parent + addNodes( + [ + { + id: '999', + type: 'input', + label: 'Added after mount', + position: { x: 20, y: 100 }, + class: 'light', + expandParent: true, + }, + ], + { + parentNode: '2', + }, + ) })