Media editor: Remove buggy "click outside canvas" logic
Co-authored-by: Evan Hahn <69474926+EvanHahn-Signal@users.noreply.github.com>
This commit is contained in:
parent
ac7bea2e0c
commit
c86ead17a3
|
@ -296,25 +296,10 @@ export const MediaEditor = ({
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleMouseup(ev: MouseEvent): void {
|
|
||||||
if (
|
|
||||||
ev.target instanceof HTMLCanvasElement ||
|
|
||||||
ev.target instanceof HTMLButtonElement
|
|
||||||
) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
setEditMode(undefined);
|
|
||||||
ev.stopPropagation();
|
|
||||||
ev.preventDefault();
|
|
||||||
}
|
|
||||||
|
|
||||||
document.addEventListener('keydown', handleKeydown);
|
document.addEventListener('keydown', handleKeydown);
|
||||||
document.addEventListener('mouseup', handleMouseup);
|
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
document.removeEventListener('keydown', handleKeydown);
|
document.removeEventListener('keydown', handleKeydown);
|
||||||
document.removeEventListener('mouseup', handleMouseup);
|
|
||||||
};
|
};
|
||||||
}, [fabricCanvas, history]);
|
}, [fabricCanvas, history]);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue