Skip to content

Commit

Permalink
Fixed two bugs in GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenthoms committed Sep 25, 2023
1 parent 108958d commit 0629f90
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ export const Header: React.FC<HeaderProps> = (props) => {
return unsubscribeFunc;
}, []);

function handlePointerUp(e: React.PointerEvent<HTMLDivElement>) {
e.stopPropagation();
}

return (
<div
className={`bg-slate-100 p-2 pl-4 pr-4 flex items-center select-none shadow ${
Expand Down Expand Up @@ -73,6 +77,7 @@ export const Header: React.FC<HeaderProps> = (props) => {
<div
className="hover:text-slate-500 cursor-pointer"
onPointerDown={props.onRemoveClick}
onPointerUp={handlePointerUp}
title="Remove this module"
>
<Close className="w-4 h-4" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,11 @@ export const Layout: React.FC<LayoutProps> = (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);
Expand Down

0 comments on commit 0629f90

Please sign in to comment.