-
-
Notifications
You must be signed in to change notification settings - Fork 514
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
Navigating back using gesture on iOS does not dismiss the keyboard #1413
Comments
I believe this (not hiding keyboard) is the expected behavior, see eg. the messages app. |
@gabrieldonadel have you tried with facebook/react-native@49a1460 ? (requires 0.68) |
Thanks for the suggestion but from my testing using |
Problem is not related to |
@felippepuhle did you check if the behavior of |
@WoLewicki nope, unfortunately we don't have any native iOS project for a quick test and unsure how we would test all these keyboard scenarios... but we did compare with the JS stack and in that case they are explicitly calling dismiss when starting the gesture and focusing again if user didn't finish the gesture and for some reason it works... I'm not saying it's We're considering applying your closed PR as a patch for now, we checked what some other react native apps are doing and discord for example is using the same approach, not perfect but much better IMO. Thanks! |
It is the OS that triggers those events (see https://github.com/facebook/react-native/blob/18196512db6b8b4469a5e1b098d8892ae72d743a/React/CoreModules/RCTKeyboardObserver.mm), but I am not sure why they are called in such way when swiping natively 😕 |
I made a PR with a prop for hiding keyboard on swipe: #1419. As for the option when we would like not to hide keyboard but also not change the frame of view, we would need changes in |
Thanks for your help @WoLewicki, yeah I think we can close this with the PR |
Does anyone have any clue as to why this is the case -- that the native keyboard frame events are firing when the keyboard is not actually being dismissed? I'd like to both not hide the keyboard but also not trigger things like flatlist keyboard insets getting automatically adjusted which all seems to be tied to the native keyboard events being triggered incorrectly... |
Description
On iOS when navigating back from a screen that was a TextInput wrapped in a KeyboardAvoidingView using the swipe gesture does not dismiss the keyboard leading to weird animation during transitions. I tested the exact same come using
@react-navigation/stack
and the keyboard gets dismissed in the beginning of the transitionScreenshots
Screen.Recording.2022-04-18.at.14.08.12.mov
Steps To Reproduce
Expected behavior
Either the keyboard should be dismissed when the navigation gesture starts, same behavior as
@react-navigation/stack
,or the container wrapped with a KeyboardAvoidingView should not be resized during the transition
Actual behavior
Keyboard remains on the screen while navigating back
Reproduction
Snack https://snack.expo.dev/@gabidonadel/chat-keyboard
Platform
Workflow
Package versions
The text was updated successfully, but these errors were encountered: