hooks
hooks copied to clipboard
useKeyboard() keyboardHeight is always 0 for first time
The same Issue Here, when I created a useEffect on keyboard.keyboardShown
keyboard height is not showing properly.
iPhone 11 (Similator)
React Native : 0.63.X
I think this happens because to measure the keyboard height, it should be shown at least one time. I didn't see the code, so I'm sorry if I'm wrong. I made a similar hook by my hand before, and this is the only way it worked. If you do not feel uncomfortable with it, you can add an invisible text input somewhere, and on app startup, you trigger its focus and then blur it. The keyboard will flash, but you will have the correct value. It is not perfect but can help while we don't have a better way.
The keyboard.keyboardShown
value is incorrect (version: 2.8.1). I have to compare the coordinates start & end to determine if the keyboard is actually shown.
I can also reproduce this. keyboardHeight
is only non-zero after using the keyboard at least once
Is there any fix for this? it's still happening for Android