Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onScroll property? #13

Open
RCNNT-Industries opened this issue Dec 16, 2024 · 0 comments
Open

onScroll property? #13

RCNNT-Industries opened this issue Dec 16, 2024 · 0 comments

Comments

@RCNNT-Industries
Copy link

RCNNT-Industries commented Dec 16, 2024

Hey,

Would it be possible to expose an onScroll prop that behaves more-or-less like FlatList?
It could be a value from Animated or Reanimated, don't think it matters to me, just something to base other animations on.

Reason for asking:

Got a screen with a header and multiple tabs at the top, and a paginated horizontal ScrollView underneath.
Each tab corresponds to a "page" in the horizontal ScrollView, and has a FlatList in it.
The header hides when scrolling down, while the tabs never scroll away — requires some trickery with absolute positioning of the header + tabs in the root view, and having spacer components in the FlatLists.

Feels like a somewhat common pattern — header and tabs needs to be managed outside the FlatList to enable swiping sideways, and enable hiding the top part of the header.

The setup solves the issues of scrolling down in one tab, and then swiping sideways to the second tab. This causes the second tabs FlatList to be shown — after which the header is animated down into view again, pushing the tabs down.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant