Skip to content

Commit 3ed91a0

Browse files
committed
fix(core): check if dimensions exist in useNodesInitialized
1 parent 78f9f61 commit 3ed91a0

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

packages/core/src/composables/useNodesInitialized.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export function useNodesInitialized(options: UseNodesInitializedOptions = { incl
2626

2727
for (const node of nodes.value) {
2828
if (options.includeHiddenNodes || !node.hidden) {
29-
if (node?.handleBounds === undefined) {
29+
if (node?.handleBounds === undefined || node.dimensions.width === 0 || node.dimensions.height === 0) {
3030
return false
3131
}
3232
}

packages/core/src/utils/graph.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ export function parseNode(node: Node, existingNode?: GraphNode, parentNode?: str
105105
width: 0,
106106
height: 0,
107107
}),
108+
// todo: shouldn't be defined initially, as we want to use handleBounds to check if a node was actually initialized or not
108109
handleBounds: {
109110
source: [],
110111
target: [],

0 commit comments

Comments
 (0)