From 88f4aa920fa4c653c02b7d844ef2b192000cdfa7 Mon Sep 17 00:00:00 2001 From: Sam Lavigne Date: Wed, 30 Aug 2023 13:49:26 -0400 Subject: [PATCH] fix chrome bug when changing input --- src/Node.svelte | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Node.svelte b/src/Node.svelte index 7712045..58ba87d 100644 --- a/src/Node.svelte +++ b/src/Node.svelte @@ -11,6 +11,12 @@ removeNode(id); } + function resetNode() { + // hack to deselect node and apply changes on chrome + $nodes.find(n => n.id === id).selected = false; + $nodes = $nodes + } + function changeFile() { const newFile = OUTPUTNAMES.find((n) => n.name === data.name); data.inputs = [...newFile.inputs]; @@ -18,9 +24,7 @@ data.ext = newFile.ext; data = data; - // hack to deselect node and apply changes on chrome - $nodes.find(n => n.id === id).selected = false; - $nodes = $nodes + resetNode(); } @@ -33,7 +37,7 @@
{#if data.nodeType == "input"} - {#each INPUTNAMES as inp} {/each}