Skip to content

TouchableOpacity can be slow to respond to touch while scrolling #336

@Jxcook

Description

@Jxcook

This issue has more than one way to reproduce, but this is the way I was able to force the issue out.

What is the current behavior?

Rendering many views and elements with TouchableOpacity can cause a 250ms-500ms lag to the initial touch of a scroll. This causes the scrolling experience to look detached from my finger and scroll a random distance. This only happens for IPhone devices in the Safari mobile browser and it does not seem to reproduce in the simulator.

What is the expected behaviour?

Should be smooth and consistently responsive, similar to the feel of using TouchableWithoutFeedback in place of TouchableOpacity. I use this to compare often when trying to reproduce the issue.

Steps to reproduce

I have spent time trying to simplify the reproduction of this issue, but the most reliable method of reproducing this is to embed views and TouchableOpacity elements something like the below example repeated 30-40 times.. The real cause I am still not certain because I have seen it happen under other types of conditions but this is the way I can force it to happen.

    <View>
      <Text>This is my first line of text for this repro</Text>
      <Text>This is my second line to repro this problem </Text>
    </View>
    <TouchableOpacity>
        <View>
          <Text>This text seems to make the issue slightly worse, but images don't seem as impactful</Text>
          <img src={logo} className="App-logo" alt="logo" />
        </View>
    </TouchableOpacity>

For comparison, you can replace TouchableOpacity with TouchableWithoutFeedback and see that there is definitely a difference in the scrolling experience.

Environment (include versions)

OS: IOS
Device: IPhone
Browser: Safari
React Native for Web (version): 0.0.51
React (version): 15.3.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions