fix(core): check if dimensions exist in useNodesInitialized
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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: [],
|
||||||
|
|||||||
Reference in New Issue
Block a user