Pull animated scroll handler down from pager #1827
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This works around software-mansion/react-native-reanimated#5345.
We don't currently have a codepath surfacing this bug, but if I try to port Profile to use the new pager, the last tab loses its scroll events. I don't know why. The "fix" is to avoid reusing the same "animated scroll handler" between the pages.
Initially I tried to pull it all the way down to the flat lists. But this change ended up affecting everything in between and turned into a mess. So this is a more scoped fix that "wraps"
onScroll
into a handler as soon as we have a notion of a page.Types should help us distinguish the two events. (I considered naming it
onScrollWorklet
but that didn't seem worth it.)Review without indentation changes
Test Plan
Checked all lists using the new pager on all platforms.