fix(core): check if dimensions exist in useNodesInitialized

This commit is contained in:
braks
2024-02-28 09:50:18 +01:00
committed by Braks
parent 78f9f61c12
commit 3ed91a0055
2 changed files with 2 additions and 1 deletions

View File

@@ -26,7 +26,7 @@ export function useNodesInitialized(options: UseNodesInitializedOptions = { incl
for (const node of nodes.value) {
if (options.includeHiddenNodes || !node.hidden) {
if (node?.handleBounds === undefined) {
if (node?.handleBounds === undefined || node.dimensions.width === 0 || node.dimensions.height === 0) {
return false
}
}

View File

@@ -105,6 +105,7 @@ export function parseNode(node: Node, existingNode?: GraphNode, parentNode?: str
width: 0,
height: 0,
}),
// todo: shouldn't be defined initially, as we want to use handleBounds to check if a node was actually initialized or not
handleBounds: {
source: [],
target: [],