react-native icon indicating copy to clipboard operation
react-native copied to clipboard

[ListView] Scroll on ListView end with an error saying "Ended a touch event which was not counted in trackedTouchCount"

Open chirag04 opened this issue 11 years ago • 31 comments

@vjeux

chirag04 avatar May 04 '15 17:05 chirag04

same problem happened to me

Duan112358 avatar May 06 '15 06:05 Duan112358

same here.

Edit: Happens when I scroll the ListView down and scroll up only a moment later.

lukasredev avatar May 06 '15 15:05 lukasredev

@vjeux Seems like a consistent bug.

chirag04 avatar May 06 '15 16:05 chirag04

@chirag04 @Duan112358 could you give us more details?

lukasredev avatar May 06 '15 16:05 lukasredev

@lukasreichart

test example of react-native/Examples/Movies

screen shot 2015-05-07 at 08 06 27

the bug is sometimes unexpectable that I couldn't figure it out.

the stack log is below

screen shot 2015-05-07 at 08 07 52

when test on a real device, the touch event doesn't respond on some list item after scrolling down to load more.

It is easy to reproduce

  • scroll down to load more and scroll back
  • random touch some list item

If some doesn't respond, then after a few seconds, the bug is appeared again.

Duan112358 avatar May 07 '15 00:05 Duan112358

It's quite easy to reproduce while scrolling around in UIExplorer app.

ssssssssssss avatar May 08 '15 06:05 ssssssssssss

The error message is correct: it seems that the trackedTouchCount isn't incremented, when the touch starts, but when the touch ends the ResponderEventPlugin tries to decrement, it which results in trackedTouchCount beeing -1. Just an theory: Maybe this error occurs because gestures are handled differently on the ListView and the ListView's elements: ListView uses ScrollView which is a separate native class and uses a UIScrollView. The ListView's elements on the other hand use the JS Gesture Responder System. Imagine the situation: The touch is first handled by the UIScrollView but as the touch changes it's also tracked by the JS Responder System. In this case the touch would never have been started (from the JS perspective) and therefore trackedTouchCount, wasn't incremented.

But maybe someone who understands more of the react-native gesture responder system could take a look? @vjeux @nicklockwood @ide ??

lukasredev avatar May 13 '15 13:05 lukasredev

I'm getting this sometimes when returning from a webpage using LinkingIOS.

jtremback avatar May 19 '15 18:05 jtremback

@jtremback any leads on how to fix this?

lukasredev avatar May 20 '15 08:05 lukasredev

I'm getting this as well.

pewallin avatar May 21 '15 13:05 pewallin

I've gotten this playing around on a iphone 5, never in the simulator.

meric426 avatar May 21 '15 13:05 meric426

@meric426 The bug also occurs in the simulator, but is more difficult to reproduce ... :/

lukasredev avatar May 21 '15 13:05 lukasredev

What libraries are people using? I'm using react-native-camera, which has been a bit sketchy in general, so I wonder if it is related.

Also, React team- is there a preferred way that everyone can dump logs so that we can examine this issue in greater detail?

jtremback avatar May 21 '15 17:05 jtremback

I'm getting this as well.

paramaggarwal avatar May 28 '15 15:05 paramaggarwal

It would be fantastic if someone could reproduce this in a simulator on rnplay.org

brentvatne avatar May 28 '15 16:05 brentvatne

@jtremback - it might be useful to set var DEBUG_SPY_MODE = true; in Libraries/Utilities/MessageQueue.js - but you will get a lot of noise from timers, so we'd probably want to filter that out.

brentvatne avatar May 30 '15 21:05 brentvatne

This is the invariant violation being fired.

paramaggarwal avatar Jun 23 '15 16:06 paramaggarwal

This bug seems to be fixed in react-native 0.6. Maybe I'll try to identify what fixed it, but for now I'am glad that my ScrolViews / ListViews are working again :+1:

lukasredev avatar Jun 29 '15 19:06 lukasredev

@lukasreichart Yes, I didn't come across it since upgrading - you might be right!

paramaggarwal avatar Jun 30 '15 02:06 paramaggarwal

Closing this issue since it sounds like it's been fixed. Please holler if it's still an issue.

ide avatar Jun 30 '15 02:06 ide