From 948320137ebfc6b62e8d46ef7c8628a57de9a3d7 Mon Sep 17 00:00:00 2001 From: Austin Mroz Date: Tue, 2 Dec 2025 01:04:18 -0800 Subject: [PATCH] Make vue inputs reactive --- src/composables/graph/useGraphNodeManager.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/composables/graph/useGraphNodeManager.ts b/src/composables/graph/useGraphNodeManager.ts index 532d73139..3a6b6154c 100644 --- a/src/composables/graph/useGraphNodeManager.ts +++ b/src/composables/graph/useGraphNodeManager.ts @@ -231,6 +231,15 @@ export function useGraphNodeManager(graph: LGraph): GraphNodeManager { reactiveWidgets.splice(0, reactiveWidgets.length, ...v) } }) + const reactiveInputs = shallowReactive(node.inputs ?? []) + Object.defineProperty(node, 'inputs', { + get() { + return reactiveInputs + }, + set(v) { + reactiveInputs.splice(0, reactiveInputs.length, ...v) + } + }) const safeWidgets = reactiveComputed(() => { node.inputs?.forEach((input, index) => { @@ -265,7 +274,7 @@ export function useGraphNodeManager(graph: LGraph): GraphNodeManager { badges, hasErrors: !!node.has_errors, widgets: safeWidgets, - inputs: node.inputs ? [...node.inputs] : undefined, + inputs: reactiveInputs, outputs: node.outputs ? [...node.outputs] : undefined, flags: node.flags ? { ...node.flags } : undefined, color: node.color || undefined,