I have added two listeners, for both keyboardDidShow & keyboardDidHide
componentDidMount() {
this.keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', this.keyboardDidShow.bind(this));
this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', this.keyboardDidHide.bind(this));
}
When I am trying to hide the keyboard on iOS, the event is passed, no problem and everything works as expected.
However on Android, no event is being received.
keyboardDidHide(e) {
console.log("keyboard did hide!");
console.log(e);
}
This code gets triggered, but e
is null.
This seems related to this other Stack Overflow question, that never seems to have gotten resolved:
KeyboardDidShow/Hide events are not working on Android with adjustResize setting
My Android Manifest file has this line - with the windowSoftInputMode set to adjustPan:
<activity android:theme="@style/SplashTheme" android:name=".MainActivity" android:launchMode="singleTop" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:windowSoftInputMode="adjustPan">
Is all of this correct? Should I be changing any of it?