From ea5c35e5faea722acd31d835a1e716aa798f3b53 Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Wed, 4 Jan 2023 13:48:40 +0100 Subject: [PATCH] chore: add changeset Signed-off-by: braks <78412429+bcakmakoglu@users.noreply.github.com> --- .changeset/hot-bobcats-jump.md | 5 +++++ examples/vite/src/Nesting/Nesting.vue | 13 +++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 .changeset/hot-bobcats-jump.md diff --git a/.changeset/hot-bobcats-jump.md b/.changeset/hot-bobcats-jump.md new file mode 100644 index 00000000..4cf74c2a --- /dev/null +++ b/.changeset/hot-bobcats-jump.md @@ -0,0 +1,5 @@ +--- +'@vue-flow/core': patch +--- + +Re-calculate position when node extent changes diff --git a/examples/vite/src/Nesting/Nesting.vue b/examples/vite/src/Nesting/Nesting.vue index 1fd0b669..c0207b34 100644 --- a/examples/vite/src/Nesting/Nesting.vue +++ b/examples/vite/src/Nesting/Nesting.vue @@ -4,7 +4,7 @@ import { Background } from '@vue-flow/background' import { Controls } from '@vue-flow/controls' import { MiniMap } from '@vue-flow/minimap' -const { onConnect, addEdges, addNodes } = useVueFlow({ +const { onConnect, addEdges, addNodes, findNode } = useVueFlow({ fitViewOnInit: true, connectionMode: ConnectionMode.Loose, nodes: [ @@ -14,7 +14,7 @@ const { onConnect, addEdges, addNodes } = useVueFlow({ label: 'Node 2', position: { x: 100, y: 100 }, class: 'light', - style: { backgroundColor: 'rgba(255, 0, 0, 0.8)', width: '200px', height: '200px' }, + style: { backgroundColor: 'rgba(255, 0, 0, 0.8)' }, }, { id: '2a', @@ -88,6 +88,15 @@ onMounted(() => { parentNode: '2', }, ]) + + setTimeout(() => { + const node = findNode('999')! + node.expandParent = false + node.extent = { + range: 'parent', + padding: [10], + } + }) })