Media editor: Remove buggy "click outside canvas" logic

This commit is contained in:
Evan Hahn 2021-12-09 12:04:30 -06:00 committed by GitHub
parent 2f88e4bdf5
commit 00fa07a070
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]);