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

fix: FlatList initialScrollIndex #233

Conversation

efstathiosntonas
Copy link
Contributor

@efstathiosntonas efstathiosntonas commented Nov 23, 2023

Items above initialScrollIndex on a fixed height list won't render, there are numerous bugs on react-native FlatList regarding this issue dated even back to 2015:

Problem:

Using this style which renders the whole list without the need to scroll it (applied on a really small list of 5 items):

optionsList: {
        maxHeight: 300
      },
      option: {
        container: {
          width: "100%",
          borderRadius: 8
        }
    }

...results in this issue shown below where the items above the initialScrollIndex are not rendered:

Screen.Recording.2023-11-23.at.11.28.45.mov

After applying the fix proposed in this PR:

Screen.Recording.2023-11-23.at.11.42.16.mov

This is without the maxHeight: mvs(300) so it works fine in all scenarios:

Screen.Recording.2023-11-23.at.11.44.14.mov

These changes align with SectionOptionsList:

Copy link

changeset-bot bot commented Nov 23, 2023

⚠️ No Changeset found

Latest commit: 04602de

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@efstathiosntonas
Copy link
Contributor Author

@MykhailoButkevych-MR MykhailoButkevych-MR merged commit dc550c8 into MobileReality:master Nov 23, 2023
1 check passed
@gitsad
Copy link
Contributor

gitsad commented Nov 23, 2023

@efstathiosntonas thanks for your contribution!

@efstathiosntonas
Copy link
Contributor Author

efstathiosntonas commented Nov 23, 2023

@gitsad anytime, keep it up!

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.

3 participants