fix: custom node example not fitting view

* fit view can't work (for the onLoad event) for elements assigned after the host has mounted (onMounted hook) as we can't calculate a rect of elements that don't exist at flow creation
* in this case just trigger fit view __after__ elements have been created/passed to the flow

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2021-11-06 08:54:35 +01:00
parent a8f7cc2389
commit 5437d48325
5 changed files with 144 additions and 156 deletions
+1 -1
View File
@@ -222,7 +222,7 @@ export const getRectOfNodes = (nodes: Node[]): Rect => {
...position,
width,
height,
} as any),
}),
),
{ x: Infinity, y: Infinity, x2: -Infinity, y2: -Infinity },
)