leecade / react-native-swiper

The best Swiper component for React Native.
MIT License
10.41k stars 2.34k forks source link

TextInput inside Swiper fires onFocus when swiping #450

Open petrgazarov opened 7 years ago

petrgazarov commented 7 years ago

Hi! Thanks for the awesome library.

The below issue is happening out of the box with react-native-swiper. I'm not sure if this is related to general ScrollView behavior, but it does not make sense to me.

        <Swiper style={styles.wrapper} showsButtons={true}>
          <View style={styles.slide1}>
            <Text style={styles.text}>Hello Swiper</Text>
          </View>
            <TextInput
              style={{backgroundColor:'white', width: 300, height: 40}}
              onFocus={ () => alert('focused')}
              onBlur={ () => alert('blurred')}
            />
          <View style={styles.slide3}>
            <Text style={styles.text}>And simple</Text>
          </View>
        </Swiper>

When swiping, if you drag on top of TextInput, it will focus it, then blur it.

See gif appvideo

I also tried the above with just using ScrollView and got it to replicate sometimes (not always).

Any thoughts on this?

alisonkohl commented 6 years ago

@petrgazarov ever get anywhere with this? running into this consistently :/

mikerodham commented 6 years ago

I'm running in to something similar, wonder if this could be taken a look at?

thomasarogers commented 5 years ago

Anyone make any progress with this? Thanks