Skip to content

Commit ceb1e2f

Browse files
committed
fix crash in android when hide keyboard
1 parent 41cad3d commit ceb1e2f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/useKeyboard.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ export default function useKeyboard() {
2525
}
2626
const handleKeyboardDidHide: KeyboardEventListener = e => {
2727
setShown(false)
28-
setCoordinates({start: e.startCoordinates, end: e.endCoordinates})
28+
if(e){
29+
setCoordinates({start: e.startCoordinates, end: e.endCoordinates});
30+
}
2931
setKeyboardHeight(0)
3032
}
3133

0 commit comments

Comments
 (0)