Skip to content

Commit

Permalink
feat: fix touch event name
Browse files Browse the repository at this point in the history
  • Loading branch information
NikitaCG committed Sep 15, 2023
1 parent 7b009f2 commit 0442647
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 @@ -26,11 +26,11 @@ export const useOutsideClick: UseOutsideClickType = ({ref, handler}) => {
};

window.addEventListener('click', callback, {capture: true});
window.addEventListener('touchstart', callback, {capture: true});
window.addEventListener('touchend', callback, {capture: true});

return () => {
window.removeEventListener('click', callback, {capture: true});
window.removeEventListener('touchstart', callback, {capture: true});
window.removeEventListener('touchend', callback, {capture: true});
};
}, [handler, ref]);
};

0 comments on commit 0442647

Please sign in to comment.