fix(core): check if dimensions exist in useNodesInitialized

This commit is contained in:
braks
2024-02-28 10:54:59 +01:00
committed by Braks
parent 78f9f61c12
commit 3ed91a0055
2 changed files with 2 additions and 1 deletions
@@ -26,7 +26,7 @@ export function useNodesInitialized(options: UseNodesInitializedOptions = { incl
for (const node of nodes.value) { for (const node of nodes.value) {
if (options.includeHiddenNodes || !node.hidden) { if (options.includeHiddenNodes || !node.hidden) {
if (node?.handleBounds === undefined) { if (node?.handleBounds === undefined || node.dimensions.width === 0 || node.dimensions.height === 0) {
return false return false
} }
} }
+1
View File
@@ -105,6 +105,7 @@ export function parseNode(node: Node, existingNode?: GraphNode, parentNode?: str
width: 0, width: 0,
height: 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: { handleBounds: {
source: [], source: [],
target: [], target: [],