From 01e38bc7d2b1b933bf474d609f8aa9ca9a323321 Mon Sep 17 00:00:00 2001 From: Va Da Date: Fri, 29 Mar 2019 16:57:47 +0100 Subject: [PATCH] feat: pass click event in useClickAway to user --- src/useClickAway.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/useClickAway.ts b/src/useClickAway.ts index 7e28b7bd5e..0a6ec7cb00 100644 --- a/src/useClickAway.ts +++ b/src/useClickAway.ts @@ -5,7 +5,7 @@ const useClickAway = (ref: RefObject, onClickAway: () => voi useEffect(() => { const handler = (event) => { const {current: el} = ref; - el && !el.contains(event.target) && onClickAway(); + el && !el.contains(event.target) && onClickAway(event); }; on(document, 'click', handler); return () => {