Skip to content

Commit

Permalink
feat: pass click event in useClickAway to user
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich authored Mar 29, 2019
1 parent 1a9146a commit 01e38bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/useClickAway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const useClickAway = (ref: RefObject<HTMLElement | null>, 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 () => {
Expand Down

0 comments on commit 01e38bc

Please sign in to comment.