Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

useKeyboard does not respect iPad floating keyboard #314

Open
jforaker opened this issue Sep 9, 2022 · 0 comments
Open

useKeyboard does not respect iPad floating keyboard #314

jforaker opened this issue Sep 9, 2022 · 0 comments

Comments

@jforaker
Copy link

jforaker commented Sep 9, 2022

Firstly thank you for the fine work!

TIL there is a thing called "floating keyboard" for iPad. You can enable it by pinching on the keyboard on iPad and disable it by un-pinching(?).

image

keyboardShown and keyboardHeight seem to misbehave when this is active and when you dismiss it.

Using the following code for the scenarios below:

  const { keyboardShown, keyboardHeight } = useKeyboard();
  console.log('keyboardHeight: ', keyboardHeight);
  console.log('keyboardShown: ', keyboardShown);

When Floating Keyboard is open from the start (maybe you already set this in another app), it logs:

 LOG  keyboardHeight:  0
 LOG  keyboardShown:  false

And then when you swipe to remove the floating keyboard and replace it with the regular keyboard, it logs (this is good):

 LOG  keyboardHeight:  337
 LOG  keyboardShown:  true

And then, pinch to enable the floating keyboard again, and it logs (this is bad):

 LOG  keyboardHeight:  337
 LOG  keyboardShown:  false

It seems like at the very least, keyboardHeight should be set to 0 on the last scenario. That way you can inform the your KeyboardAvoidingView to be enabled={false}. That is how I discovered the issue.

There is a decent answer here about detecting the floating keyboard. Perhaps some additional fields could be added to the hook to make it more useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant