Skip to content

Commit 90fe0d2

Browse files
authored
Merge pull request #8 from Naismith/master
pass event to onClickAway prop
2 parents 8067179 + 8d1b9cf commit 90fe0d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ type MouseEvents = 'click' | 'mousedown' | 'mouseup';
44
type TouchEvents = 'touchstart' | 'touchend';
55

66
interface Props {
7-
onClickAway: Function;
7+
onClickAway: (event: MouseEvent | TouchEvent) => void;
88
mouseEvent?: MouseEvents;
99
touchEvent?: TouchEvents;
1010
}
@@ -23,7 +23,7 @@ const ClickAwayListener: FunctionComponent<Props> = ({
2323
return;
2424
}
2525

26-
onClickAway();
26+
onClickAway(event);
2727
};
2828

2929
document.addEventListener(mouseEvent, handleEvents);

0 commit comments

Comments
 (0)