Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 29594

keyboardDidHide fires, but does not pass event data on Android

$
0
0

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?


Viewing all articles
Browse latest Browse all 29594

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>