From 395b9e8c5cc43ba6741145621648dab2ed36009e Mon Sep 17 00:00:00 2001 From: Christiaan Scheermeijer Date: Wed, 4 Aug 2021 09:53:02 +0200 Subject: [PATCH] fix(project): fix user menu not opening in some cases --- src/components/DetectOutsideClick/DetectOutsideClick.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/DetectOutsideClick/DetectOutsideClick.tsx b/src/components/DetectOutsideClick/DetectOutsideClick.tsx index bd0dac0fd..a1e9ccf25 100644 --- a/src/components/DetectOutsideClick/DetectOutsideClick.tsx +++ b/src/components/DetectOutsideClick/DetectOutsideClick.tsx @@ -19,7 +19,7 @@ const DetectOutsideClick = ({ callback, children }: Prop) => { } }; - document.addEventListener('click', handleClick); + setTimeout(() => document.addEventListener('click', handleClick), 1); return () => document.removeEventListener('click', handleClick); }, [callback]);