From e2f9a116c5984b1aa6a2c97973256b58f9e43003 Mon Sep 17 00:00:00 2001 From: Martin Vladic Date: Sat, 28 Sep 2024 14:06:14 +0200 Subject: [PATCH] fix: removing event handler type action deletes flow connection lines --- packages/project-editor/flow/component.tsx | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/packages/project-editor/flow/component.tsx b/packages/project-editor/flow/component.tsx index 49418362..eeb7f1d0 100644 --- a/packages/project-editor/flow/component.tsx +++ b/packages/project-editor/flow/component.tsx @@ -2553,15 +2553,17 @@ export class EventHandler extends EezObject { }, deleteObjectRefHook: (eventHandler: EventHandler) => { - const widget = getAncestorOfType( - eventHandler, - ProjectEditor.WidgetClass.classInfo - )!; - - ProjectEditor.getFlow(widget).deleteConnectionLinesFromOutput( - widget, - eventHandler.eventName - ); + if (eventHandler.handlerType == "flow") { + const widget = getAncestorOfType( + eventHandler, + ProjectEditor.WidgetClass.classInfo + )!; + + ProjectEditor.getFlow(widget).deleteConnectionLinesFromOutput( + widget, + eventHandler.eventName + ); + } }, defaultValue: {