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

Implement scrollToLine by checking "overridden" layouts #89

Merged
merged 4 commits into from
Apr 18, 2024
Merged

Conversation

mhoran
Copy link
Owner

@mhoran mhoran commented Apr 17, 2024

This seems to be a suitable substitute for the lack of onScrollToIndexFailed in FlashList.

While not currently used, position: absolute on the text element fixes
height calculation. Move the opacity to the wrapper in case we need to
measure anything else in the future.
Fixes for privacy manifest requirements.
Fixes for privacy manifest requirements.
Scroll to the target index in a loop until the layout returned by the
layout manager isOverridden. This indicates that the target cell has
actually been measured and can be scrolled to reliably.

Similarly to FlatList, we must reset the internal measurement state via
key prop to work around the layout manager indicating that the target
index has been measured. This is because the prepended items may have
invalidated the isOverridden indication for the given index.
@mhoran mhoran merged commit bed9e33 into main Apr 18, 2024
4 checks passed
@mhoran mhoran deleted the flashlist branch April 18, 2024 01:48
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

Successfully merging this pull request may close these issues.

1 participant