Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue with interruptted scroll cause touch in scroll view unrespo…
…nsive Summary: This diff fixed an issue that caused regression in fb4a and React Native panel apps regarding scrolling behavior. When scrolling in either horizontal or vertical scroll view, if the consecutive touch interrupted the previous fling (post touch scrolling), the scroll view would block touch event from dispatching to the content view. Thus, the items in scroll view are not responding to touch events anymore. The diff that caused this issue is D34627330 (0368081). In that diff, I added code to cancel the scheduled post touch runnable when touch down is received in scroll view. That is expected as the post touch runnable is to handle snapping scroll case, where [an extra fling](https://fburl.com/code/7qza1ece) is triggered to make sure scroll view stops at the right position. When user touch the screen before the previous scroll fling finishes, this post processing is no longer needed -- the new touch should take full control of scroll view. However, in D34627330 (0368081), I failed to reset the runnable instance `mPostTouchRunnable` to null when cancelling it. This caused the future post touch handle logic [stops to run](https://fburl.com/code/lh8pi7l0), as it thinks the runnable is non-null and has been scheduled. This prevents fabric from receiving proper scroll state updates from android side, thus causing a state corruption and affects logic to decide where the scroll offset is and where the child item is after that. This diff fixed the issue by resetting the runnable instance, as well as making sure if the runnable is already running and the extra fling starts, we are canceling that fling animation properly. Changelog: [Android][Fixed] - Fixed regression on content in scroll view not responding to touch when fling got interrupted Reviewed By: ShikaSD Differential Revision: D34734129 fbshipit-source-id: 7d7689d203ce76c59cd44e16e31582317bb409bd
- Loading branch information