Media editor: Remove buggy "click outside canvas" logic
This commit is contained in:
parent
2f88e4bdf5
commit
00fa07a070
1 changed files with 0 additions and 15 deletions
|
@ -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]);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue