Skip to content

Commit a4a7b99

Browse files
committed
fix: focus out should call onBlur 🫠
1 parent a5f3cdd commit a4a7b99

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,15 @@ interface Props extends HTMLAttributes<HTMLElement> {
2626
const eventTypeMapping = {
2727
click: 'onClick',
2828
focusin: 'onFocus',
29-
focusout: 'onFocus',
29+
focusout: 'onBlur',
3030
mousedown: 'onMouseDown',
3131
mouseup: 'onMouseUp',
3232
touchstart: 'onTouchStart',
3333
touchend: 'onTouchEnd'
3434
};
3535

36+
const reactMajorVersion = parseInt(React.version.split('.')[0], 10);
37+
3638
const mergeRefs = <T extends any>(
3739
refs: Array<Ref<T> | undefined | null>
3840
): RefCallback<T> => {
@@ -47,8 +49,6 @@ const mergeRefs = <T extends any>(
4749
};
4850
};
4951

50-
const reactMajorVersion = parseInt(React.version.split('.')[0], 10);
51-
5252
const ClickAwayListener: FunctionComponent<Props> = ({
5353
children,
5454
onClickAway,

0 commit comments

Comments
 (0)