mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-05 00:10:16 +00:00
refactor(useOutsideClick): update event handlers to combine with onContextMenu handler
This commit is contained in:
parent
0eca23873f
commit
dcff82ff45
1 changed files with 4 additions and 4 deletions
|
|
@ -12,12 +12,12 @@ const useOutsideClick = (callback: () => void) => {
|
|||
}
|
||||
};
|
||||
|
||||
document.addEventListener('mouseup', handleClickOutside);
|
||||
document.addEventListener('touchend', handleClickOutside);
|
||||
document.addEventListener('mousedown', handleClickOutside);
|
||||
document.addEventListener('touchstart', handleClickOutside);
|
||||
|
||||
return () => {
|
||||
document.removeEventListener('mouseup', handleClickOutside);
|
||||
document.removeEventListener('touchend', handleClickOutside);
|
||||
document.removeEventListener('mousedown', handleClickOutside);
|
||||
document.removeEventListener('touchstart', handleClickOutside);
|
||||
};
|
||||
}, [callback]);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue