leecade / leecade/react-native-swiper

TextInput inside Swiper fires onFocus when swiping

Open
#450 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
10.5k
Forks
2.3k
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is identified in the report. Reproduce the provided Swiper/TextInput example, compare it with the reported intermittent ScrollView behavior, and trace the focus and blur events during a swipe; done means the triggering behavior is understood and a verified regression test or fix can be specified.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react-native
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.