mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: hide canvas-modifying UI in view mode (#5815)
* fix: hide canvas-modifying UI in view mode * add class for better targeting * fix missing `key` * fix: useOutsideClick not working in view mode
This commit is contained in:
parent
7f91cdc0c9
commit
8c298336fc
4 changed files with 61 additions and 40 deletions
|
@ -21,10 +21,11 @@ export const useOutsideClickHook = (handler: (event: Event) => void) => {
|
|||
|
||||
handler(event);
|
||||
};
|
||||
document.addEventListener("mousedown", listener);
|
||||
|
||||
document.addEventListener("pointerdown", listener);
|
||||
document.addEventListener("touchstart", listener);
|
||||
return () => {
|
||||
document.removeEventListener("mousedown", listener);
|
||||
document.removeEventListener("pointerdown", listener);
|
||||
document.removeEventListener("touchstart", listener);
|
||||
};
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue