Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native ScrollView not scrolling when keyboard is open

Here is a demo of the problem: https://rnplay.org/apps/zqmeDg

Also, you'll notice that the whole viewport shifts up when keyboard opens. This problem has halted development of our product in its final stages.

I have also filed a github issue for the same: https://github.com/facebook/react-native/issues/6757

Please help

like image 208
kapv89 Avatar asked Apr 09 '26 14:04

kapv89


1 Answers

If you don't want the keyboard to shift the viewport you have to set that in Android's manifest file (android/app/src/main/AndroidManifest.xml). Just add the line bellow to your activity:

android:windowSoftInputMode="adjustPan"

You can find more info here.

The scrolling issue is strange and unfortunatelly I couldn't run your demo to try to figure it out, but take a look at keyboardShouldPersistTaps and scrollEnabled props in your ScrollView element.

Hope that helps.

like image 62
Bertrand Avatar answered Apr 12 '26 04:04

Bertrand