From 6fc5e22f25918d7264ad117e54d46faf4f757c83 Mon Sep 17 00:00:00 2001 From: phuocantd Date: Mon, 29 Nov 2021 11:39:24 +0700 Subject: [PATCH] setKeyboardShown in willshow and willhide --- src/useKeyboard.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/useKeyboard.ts b/src/useKeyboard.ts index 90ff5399..ce433833 100644 --- a/src/useKeyboard.ts +++ b/src/useKeyboard.ts @@ -21,6 +21,7 @@ export function useKeyboard() { const [keyboardHeight, setKeyboardHeight] = useState(0) const handleKeyboardWillShow: KeyboardEventListener = (e) => { + setShown(true) setCoordinates({start: e.startCoordinates, end: e.endCoordinates}) } const handleKeyboardDidShow: KeyboardEventListener = (e) => { @@ -29,6 +30,7 @@ export function useKeyboard() { setKeyboardHeight(e.endCoordinates.height) } const handleKeyboardWillHide: KeyboardEventListener = (e) => { + setShown(false) setCoordinates({start: e.startCoordinates, end: e.endCoordinates}) } const handleKeyboardDidHide: KeyboardEventListener = (e) => {