-
Notifications
You must be signed in to change notification settings - Fork 289
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
ScrollTo doesn't take paddingTop in account. #702
Comments
Can you provide a repro on expo snack? I'll be able to quickly take a look. This was verified to work in our testing. |
In your sample, the list is starting from the top of the screen. And padding is being considered during the scroll. I've moved the overlay to the bottom to make you realize what's going on. Item no. 6 is going to the top as expected: https://snack.expo.dev/@naqvitalha/nervous-macaroni-and-cheese---fixed |
Yeah but we actually don't want it to go to the top. We want the item to go to the top - padding top |
You can pass your paddingTop value as viewOffset when you call scrollToIndex. |
Ah oke! Thank you very much! |
is #1311 the expected behavior as well? how would using viewOffset fix the issue there? |
Current behavior
This is our flashlist. It contains a list of products.
As you can see we have a paddingTop and paddingBottom. When we do not have those, the scrollTo works perfectly. But when we have padding, it completely forgets about those paddings and just ignores them while scrolling. So, when we scroll to an item, we end up with a different item.
^ScrollToOffset seems to acknowledge the padding.
^ScrollToIndex & scrollToItem does not acknowledge the padding.
Expected behavior
ScrollTo should take in account for the padding.
Platform:
Environment
"@shopify/flash-list": "1.1.0",
The text was updated successfully, but these errors were encountered: