-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
fix useAnimatedKeyboard when keyboard type changes #5337
Conversation
@andreysam Sure thing! Thanks for submitting this PR, we'll review it soon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your PR! 🙌
## Summary FIxes #5208 For some reasons i don't understand, android's WindowInsetsAnimationCompat.Callback don't run any animations when keyboard height changes (maybe because there is no animation 🤔). It only works when keyboard opens/closes. I personally had a problem with emoji keyboard. User opens text keyboard, then goes into emoji (same problem in gboard gif/stickers) and keyboard gets bigger, but app doesn't. setOnApplyWindowInsetsListener on the other hand knows about new keyboard's height and in my commit i just send this update without any animation to updateKeyboard. ## Test plan I've tested this on my samsung a71 with android 13 (one ui 5.1). Needs testing on 1. <11 android without keyboard animation support 2. other os 3. other keyboards
Is this actually fixed? It occurs on Also, this seems not only react-native-reanimated's problem. |
I don't have any problems with keyboard height. Maybe there is a problem with your AndroidManifest.xml? My Activity has android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode" android:windowSoftInputMode="adjustResize" and it works great. |
Thank you for your quick response! Upon further examination, I've determined that the issue I am experiencing (although it leads to the same outcome as the issue you posted) is inherent to React-Native. I found that continuously measuring the keyboard height using setInterval and Keyboard.measure() while switching the focused input, Keyboard.measure() consistently returns the keyboard height from the initial focus, even if the keyboard height changes. Additionally, attempts to receive "keyboardDidChangeFrame" and "keyboardWillChangeFrame" events through Keyboard.addListener() also confirmed that these events do not occur as expected. I have documented this issue on React-Native's GitHub page: facebook/react-native#44200 |
Summary
FIxes #5208
For some reasons i don't understand, android's WindowInsetsAnimationCompat.Callback don't run any animations when keyboard height changes (maybe because there is no animation 🤔). It only works when keyboard opens/closes. I personally had a problem with emoji keyboard. User opens text keyboard, then goes into emoji (same problem in gboard gif/stickers) and keyboard gets bigger, but app doesn't. setOnApplyWindowInsetsListener on the other hand knows about new keyboard's height and in my commit i just send this update without any animation to updateKeyboard.
Test plan
I've tested this on my samsung a71 with android 13 (one ui 5.1). Needs testing on