question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FlatList - Extreme scrolling breaks touches with focused TextInput

See original GitHub issue

Description

With a FlatList that has a fairly large number of items, sometimes you can scroll far/fast enough to permanently break something around TextInputs and touches. After “extreme” scrolling inside the FlatList, and after something is typed into a TextInput, the first touch outside the TextInput is swallowed. The second touch works as normal. It’s hard to describe so I made a test project to reproduce and recorded a video to show every step and the resulting error.

The video is recorded using the iOS simulator, but the bug occurs on every iOS system we’ve tried so far, regardless of hardware or OS version. We have yet to reproduce it on Android.

We’re not sure of the relevance of scroll speed, Y position, or number of items. Our live application has much fewer items than the test application in the video, but it’s still easy to reproduce there. Probably because those items are more taxing on the hardware (images, different opacity etc). But that’s all conjecture.

Either way this happens organically in our application and is preventing us from releasing our move away from ListView to production, which is a shame because overall the performance improvements with FlatList have been fantastic.

Reproduction

This repository contains the test application from the video above. scrolltest.js has all the relevant code.

Clone the repository, npm install, react-native run-ios, quickly scroll through the list, type something in the text input and try the “Clear” button. I highly recommend watching the video so you’ll know what I’m talking about.

Additional Information

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:8
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
ptomasrooscommented, Mar 17, 2017

What a hero @shergin! Looking forward to it!

2reactions
shergincommented, Mar 17, 2017

I found an actual problem. The fix is coming! 🎉

Read more comments on GitHub >

github_iconTop Results From Across the Web

TextInput inside a FlatList loses focus when off-screen
When a TextInput is focused and the user scrolls ...
Read more >
nested textinput on scrollview react native - You.com | The AI ...
If you nest a FlatList in a ScrollView then focus a TextInput you can only scroll the outer ScrollView . If the TextInput...
Read more >
Common bugs in React Native ScrollView and how to fix them
React Native's ScrollView component is ubiquitous, but its implementation can sometimes lead to mistakes. Learn what to look out for here.
Read more >
Fullstack react native sample code - Weebly
'react-native') Difference between FlatList and ScrollView Should now have ... you may have noticed is that when you focus on the input field...
Read more >
Scroll to a Specific Item in ScrollView List View - About React
In this example, we will create a List using Scroll View to hold the data, a TextInput and a button to take the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found