callstack / react-native-pager-view

React Native wrapper for the Android ViewPager and iOS UIPageViewController.
MIT License
2.77k stars 422 forks source link

Android: Keyboard gets closed immediately #670

Open asapMaki opened 1 year ago

asapMaki commented 1 year ago

Environment

"react-native-pager-view": "^6.1.2" "react-native": "0.65.3" "react-navigation": all packages 5.x.x "react-native-screens": "3.4.0", -> this is where usually this bug is solved but it didn't work for me

AndroidManifest.xml: android:windowSoftInputMode="adjustResize" - I need this, otherwise adjustPan pushes the header as well when keyboard is opened

Description

So after trying out many combinations and solutions, this is what I found. Hope you can help me.

We have multi page apply form process. This includes input on almost every screen. Issue happens first time when I focus on input, it automatically closes. I tried combinations when:

Reproducible Demo

viewPager?.current?.setPage(currentPage + 1)

<PagerView
      style={{ flex: 1 }}
      initialPage={0}
      scrollEnabled={false}
      ref={viewPager}>
      <View key="0">
        <Input
          name="input"
          placeholder="placeholder"
        />
      </View>
      <View key="1">
        <Input
          name="input"
          placeholder="placeholder"
        />
      </View>
      <View key="2">
        <Input
          name="input"
          placeholder="placeholder"
        />
      </View>
    </PagerView>
SemenovDeveloper commented 1 year ago

Have same problem

robertpg3 commented 1 year ago

Same problem. We need a fix as soon as possible.

dcanora commented 1 year ago

Anyone find a workaround?

I'm not using PagerView directly, but I believe I'm seeing the same issue via react-navigation-material-top-tabs.

"react-native": "0.71.13",
"react-native-pager-view": "6.1.2",
"@react-navigation": all 6.x.x
"react-native-screens": "~3.20.0",

Edit: To elaborate, I've seen some reports where the keyboard only closes on the first focus. In my situation, the field blurs and keyboard closes every time any <TextInput/> is tapped, making it impossible to enter text.

AyoCodess commented 8 months ago

i have the same issue on the first tap. @asapMaki did you solve this?

MrTurtlev2 commented 4 months ago

Same problem, "react-native-pager-view": "^6.3.1", "react-native": "0.68.0",