From 73174d12cfba9f8c6dfe0831dcc0c3fc9603077e Mon Sep 17 00:00:00 2001 From: Ruben Thoms <69145689+rubenthoms@users.noreply.github.com> Date: Mon, 25 Sep 2023 11:27:10 +0200 Subject: [PATCH] Fixed two bugs in GUI (#349) --- .../ViewWrapper/private-components/header.tsx | 5 +++++ .../components/Content/private-components/layout.tsx | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/frontend/src/framework/internal/components/Content/private-components/ViewWrapper/private-components/header.tsx b/frontend/src/framework/internal/components/Content/private-components/ViewWrapper/private-components/header.tsx index 2208b481b..eb0f42009 100644 --- a/frontend/src/framework/internal/components/Content/private-components/ViewWrapper/private-components/header.tsx +++ b/frontend/src/framework/internal/components/Content/private-components/ViewWrapper/private-components/header.tsx @@ -38,6 +38,10 @@ export const Header: React.FC = (props) => { return unsubscribeFunc; }, []); + function handlePointerUp(e: React.PointerEvent) { + e.stopPropagation(); + } + return (
= (props) => {
diff --git a/frontend/src/framework/internal/components/Content/private-components/layout.tsx b/frontend/src/framework/internal/components/Content/private-components/layout.tsx index 49927b695..7ba57d698 100644 --- a/frontend/src/framework/internal/components/Content/private-components/layout.tsx +++ b/frontend/src/framework/internal/components/Content/private-components/layout.tsx @@ -286,6 +286,11 @@ export const Layout: React.FC = (props) => { LayoutEventTypes.MODULE_INSTANCE_POINTER_DOWN, handleModuleInstancePointerDown ); + document.removeEventListener(LayoutEventTypes.NEW_MODULE_POINTER_DOWN, handleNewModulePointerDown); + document.removeEventListener( + LayoutEventTypes.REMOVE_MODULE_INSTANCE_REQUEST, + handleRemoveModuleInstanceRequest + ); document.removeEventListener("pointerup", handlePointerUp); document.removeEventListener("pointermove", handlePointerMove); document.removeEventListener("keydown", handleButtonClick);