Skip to content

Commit

Permalink
feat: mousedown -> mouseup
Browse files Browse the repository at this point in the history
  • Loading branch information
NikitaCG committed Sep 19, 2023
1 parent 2e8e554 commit 3d2f4fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/utils/useOutsideClick/useOutsideClick.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ export const useOutsideClick: UseOutsideClickType = ({ref, handler}) => {
}
};

window.addEventListener('mousedown', callback, {capture: true});
window.addEventListener('mouseup', callback, {capture: true});
window.addEventListener('touchend', callback, {capture: true});

return () => {
window.removeEventListener('mousedown', callback, {capture: true});
window.removeEventListener('mouseup', callback, {capture: true});
window.removeEventListener('touchend', callback, {capture: true});
};
}, [handler, ref]);
Expand Down

0 comments on commit 3d2f4fa

Please sign in to comment.