Skip to content

Commit

Permalink
Merge pull request #8 from Naismith/master
Browse files Browse the repository at this point in the history
pass event to onClickAway prop
  • Loading branch information
ooade authored May 8, 2020
2 parents 8067179 + 8d1b9cf commit 90fe0d2
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 90fe0d2

Please sign in to comment.