-
Notifications
You must be signed in to change notification settings - Fork 24.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
Keyboard events not working on Android #10613
Comments
Is this happening on a brand new project? Can you add breakpoints to see if these are ever called? react-native/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java Lines 302 to 332 in 9ee815f
|
Tried this on a new 0.36 project and it works as expected:
I'm not sure what is needed to make it work -- if you have a lot of custom Android code it might be worth creating a new project, copying the android directory in and overwriting everything and then painfully stepping over the diff to see what is missing. Let us know what you find! |
Working fine for me too in an existing project. |
I've not added anything to the manifest. |
Investigating...standby... |
Ok, figured out why it wasn't working. I was using the following code in if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
} The keyboard events are way more important so I suppose I'll just find a different way of dealing with the status bar. Worth leaving this open to possibly support both cases or no? |
@marcshilling You can just set transparent statusbar in the theme. Keyboard events worked fine with it last time I tried. Tough I'd recommend setting the |
@satya164 yup, looks like |
i still cannot get the event working on RN42,
|
Nope, just a typo in my Platform.OS check... its working now. Make sure you have |
I've kind of the same issue. Edit: |
@brentvatne I can confirm @jonas-arkulpa's findings. On iOS, both 'will' and 'did' are fired. On Android, only 'did'. |
Indeed on Android Tracking here: #14275 |
@jonas-arkulpa I'm also trying to get https://github.com/wix/react-native-keyboard-aware-scrollview to work on Android. I'm noticing another difference between the behavior of iOS and Android. It looks like 'keyboardDidShow' fires every time when entering a TextField on iOS even if the keyboard is up. In Android it only fires once, that is if the keyboard is already up it doesn't fire when entering a TextField. The Android behavior seems more correct but unfortunately I actually want the iOS behavior. It would be great if the behavior was consistent. |
Any update? @andresfcamacho |
Still an issue with react-native 0.50.0, is this being worked on? Can this be reopened? |
RN 0.36, Samsung Galaxy S6 running Android 6.0.1.
Logging in those methods, I can see that they are called on iOS, but not Android. I've read all the other issue threads regarding this but most of them are old at this point. I've added
android:windowSoftInputMode="adjustResize"
to my manifest. What am I missing?The text was updated successfully, but these errors were encountered: