Skip to content

Commit

Permalink
pass event to onClickAway prop
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Naismith committed May 8, 2020
1 parent 174d72f commit 8d1b9cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type MouseEvents = 'click' | 'mousedown' | 'mouseup';
type TouchEvents = 'touchstart' | 'touchend';

interface Props {
onClickAway: Function;
onClickAway: (event: MouseEvent | TouchEvent) => void;
mouseEvent?: MouseEvents;
touchEvent?: TouchEvents;
}
Expand All @@ -23,7 +23,7 @@ const ClickAwayListener: FunctionComponent<Props> = ({
return;
}

onClickAway();
onClickAway(event);
};

document.addEventListener(mouseEvent, handleEvents);
Expand Down

0 comments on commit 8d1b9cf

Please sign in to comment.