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

FlashList taking more space than necessary #1319

Open
1 of 2 tasks
Gandhi89 opened this issue Aug 14, 2024 · 0 comments
Open
1 of 2 tasks

FlashList taking more space than necessary #1319

Gandhi89 opened this issue Aug 14, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Gandhi89
Copy link

When using FlashList in a SafeAreaView with a View below it, the FlashList takes more space than needed, pushing the View down. This behavior is different from FlatList, which only takes the height it needs to show the items, leaving the remaining space for the View.

Current behavior

When using FlashList in a SafeAreaView with a View below it, the FlashList takes more space than needed, pushing the View down.

function Flash() {
  return (
    <SafeAreaView style={{ flex: 1 }} edges={["top"]}>
      <FlashList data={[1, 2, 3, 4, 5, 6]} renderItem={({ item }) => <Text>{item}</Text>} />

      <View style={{ backgroundColor: "grey", flex: 1 }} />
    </SafeAreaView>
  );
}
Screenshot 2024-08-14 at 10 13 56 AM

Expected behavior

The FlashList should behave like FlatList, taking only the height it needs to display its items and leaving the remaining space for the View below it.

Screenshot 2024-08-14 at 10 13 04 AM

To Reproduce

Platform:

  • iOS
  • Android

Environment

@shopify/flash-list": "^1.7.1

@Gandhi89 Gandhi89 added the bug Something isn't working label Aug 14, 2024
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

1 participant