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

scrollToIndex() not accounting for padding in horizontal FlashList and initialScrollIndex not accurate #1311

Open
2 tasks done
trevorpfiz opened this issue Aug 8, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@trevorpfiz
Copy link

trevorpfiz commented Aug 8, 2024

Current behavior

https://www.loom.com/share/75347ae785e342b3ae08237c1a089620?sid=84d33c94-5093-496d-98a4-d7f2de061bd2

Expected behavior

I would expect scrollToIndex to account for the horizontalPadding in a horizontal FlashList. I would also expect initialScrollIndex to scroll to the last item and have it be in the center of the screen like the inverted lists starting at the first item.

To Reproduce

https://snack.expo.dev/@elektrikspark/thrilled-orange-stroopwafels
https://github.com/trevorpfiz/flashlist-bugs-demo

Platform:

  • iOS
  • Android

Environment

1.7.1 and 1.7.0

Reach out if more information is needed! Thanks!

@trevorpfiz trevorpfiz added the bug Something isn't working label Aug 8, 2024
@hmust92
Copy link

hmust92 commented Oct 3, 2024

I am running into the same issue. Whenever i provide the initialScrollIndex prop, it just doesn't take the padding I apply as part of contentContainerStyle into account. If I do not provide this prop, it seems to start off perfectly fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants