callstack / react-native-pager-view

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

TextInput is not focusing on multiple pages #250

Closed PankajChaturvediDtechies closed 3 years ago

PankajChaturvediDtechies commented 3 years ago

Ask your Question

Hello everyone I am using a view pager for the video scrolling page and using the bottom sheet to add comments, now the text input is not focusing in development mode, and in production, it takes two taps to be focused. Even using the normal code without a video page I am facing the same issue. this is my simple code where textinput is not getting fuscused. tried with all options of setting heights of the pages but still it is not working.

const {height} = Dimensions.get('window');
 <ViewPager
      style={{height: height * 0.91}}
      orientation="vertical"
      onPageSelected={(e) => setSelected(e.nativeEvent.position)}
      initialPage={index}>
      {videos.map((item, index) => {
        return (
         <View
            key={index}
            backgroundColor="gray"
            style={{
              height: height * 0.91,
              alignContent: 'center',
              alignItems: 'center',
              justifyContent: 'center',
            }}>
            <StatusBar translucent backgroundColor="grey" />
            {/* <VideoPlayer
              video={item}
              navigation={navigation}
              isPlay={selected === index}
            /> */}
            <TextInput placeholder={item._id}></TextInput>
          </View>
        );
      })}
    </ViewPager>
troZee commented 3 years ago

What version is used in above code ? Could you check 4.2.0 ?

magicismight commented 3 years ago

Same issue on @4.2.1

magicismight commented 3 years ago

155

PankajChaturvediDtechies commented 3 years ago

What version is used in above code ? Could you check 4.2.0 ?

version of viewpager is 4.1.6

MateWW commented 3 years ago

@PankajChaturvediDtechies Hi, I'm trying to reproduce your problem but it work's for me on latest version as well as next. Could you provide some reproduction repository or check if it works with latest version?

leoafarias commented 3 years ago

I am having the same issue. Tried to create a snack but it happens in a specific case. For me it only happens when I open the screen in a materialBottomBar navigator. I am guessing that it could have something to do with the height.

cjhines commented 3 years ago

@leoafarias Also having issues in MaterialTopTabNavigator.

Did you find a solution / workaround?

troZee commented 3 years ago

duplicated: https://github.com/callstack/react-native-pager-view/issues/382

ethandpowers commented 2 months ago

This issue appears still, if the PagerView is inside a KeyboardAvoidingView