keyboardWillShow not triggered in Android
I am registering for keyboardWillShow like this:
this.addListenerOn(RCTDeviceEventEmitter, 'keyboardWillShow', this.updateKeyboardSpace);
This works fine in iOS, but in Android it does not trigger the event as expected. keyboardDidShow does work in Android.
I can confirm this.
Yes, we have the same problem.
so it is not supported in Android?
Keyboard events are unimplemented on Android.
@yychun1217 KeyboardDidShow and KeyboardDidHide works on Android, so I guess whatever you wanted to do with will show events, you could do on did show instead.
@satya164 Both KeyboardDidShow and keyboardWillShow events will not been triggered on Android, as I've set android:windowSoftInputMode to adjustResize.
componentDidMount() {
DeviceEventEmitter.addListener('KeyboardDidShow', e => {
// Nope
});
DeviceEventEmitter.addListener('keyboardWillShow', e => {
// Nope
});
}
@matth3wga0 I'm using adjustResize and KeyboardDidShow and KeyboardDidHide work just fine. - https://github.com/scrollback/io.scrollback.neighborhoods/blob/master/app/views/keyboard-spacer.js
@satya164 I'm using v0.14.2 and running on Android 5.1, what's yours?
@matth3wga0 Was using 0.12 previously, now using 0.15-rc, on Android 5.1.
@satya164 Thanks, I'll have a try with 0.15-rc.
Im using RN 0.18-rc with a Moto X 5.1, keyboardDidHide and keyboardDidShow are both triggered on the showing of the keyboard (Actually, keyboardDidHide is triggered before DidShow!).

Nothing is triggered on the hiding of the keyboard.
keyboardWillShow and keyboardDidHide are not in RN 0.18-rc
+1 for interest
+1 Iv'e been trying any way I could find, it looks like any method of knowing when the keyboard is up and it's height does not work anymore :(
Does anyone have a workaround for this?
+1 RN: 18.1, Android: 5.0.2, Device: LG G2
I use keyboardDidHide and keyboardDidHide here is source code https://github.com/facebook/react-native/blob/228a1fe7d48d57a0fbb2d852135ef94247198aaa/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java#L424
+1 this still doesn't work in android
ok, i somehow missed this, so...
for anybody who was confused (like me :)) i can confirm that keyboardWillShow + keyboardWillHide don't work on android but keyboardDidShow and keyboardDidHide do work on android.
thanks @skv-headless
@zoharlevin Holy crap it works! Thanks!
it works, thanks man
On Wed, Feb 24, 2016 at 9:03 AM, motiazu [email protected] wrote:
@zoharlevin https://github.com/zoharlevin Holy crap it works! Thanks!
— Reply to this email directly or view it on GitHub https://github.com/facebook/react-native/issues/3468#issuecomment-188147867 .