From 0442647b8a408acab3fb0519e2533436ea9b887e Mon Sep 17 00:00:00 2001 From: ngorin Date: Fri, 15 Sep 2023 10:21:34 +0300 Subject: [PATCH] feat: fix touch event name --- src/components/utils/useOutsideClick/useOutsideClick.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/utils/useOutsideClick/useOutsideClick.tsx b/src/components/utils/useOutsideClick/useOutsideClick.tsx index 0c54c8afbf..68a8351758 100644 --- a/src/components/utils/useOutsideClick/useOutsideClick.tsx +++ b/src/components/utils/useOutsideClick/useOutsideClick.tsx @@ -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]); };