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:
automated-signal 2021-12-09 11:45:45 -08:00 committed by GitHub
parent ac7bea2e0c
commit c86ead17a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 15 deletions

View File

@ -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('mouseup', handleMouseup);
return () => {
document.removeEventListener('keydown', handleKeydown);
document.removeEventListener('mouseup', handleMouseup);
};
}, [fabricCanvas, history]);