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 49de79d commit ec50e1a
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 ec50e1a

Please sign in to comment.