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

In React Native's FlatList, setting a height of 500px allows it to shrink to the content size if smaller or take the full 500px if larger. However, in Shopify's FlashList, setting the same height doesn't shrink when content is smaller, causing UI issues. #1368

Open
2 tasks done
ManishSalesgent opened this issue Sep 30, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@ManishSalesgent
Copy link

ManishSalesgent commented Sep 30, 2024

Current behavior

Expected behavior

To Reproduce

Platform:

  • iOS
  • Android

Environment

x.y.z

@ManishSalesgent ManishSalesgent added the bug Something isn't working label Sep 30, 2024
@ManishSalesgent
Copy link
Author

<View style={{ flex: !height && 1 }}>
<SearchFilterComponent
columns={columns}
initialValues={{ filters: tableFilters?.filters }}
onSubmitFilters={onSubmitFilters}
/>
<View
style={{
height: height || Dimensions.get("screen").height - 210,
}}
>
<FlashList
data={tableData.data}
refreshing={refreshing}
onRefresh={tableData?.pageable && handleRefresh}
onEndReachedThreshold={1}
onEndReached={() => {
tableData?.pageable && fetchNextPage();
}}
ListEmptyComponent={!(isLoading || refreshing || tableData?.data?.length) && }
renderItem={({ item, index }) => }
estimatedItemSize={400}
keyExtractor={(item, index) => String(item?.id || index)}
ListFooterComponent={
<>
{!isLoading && footer && <>{footer}</>}
{isLoading && }
</>
}
/>

{onCreateAction || actions?.length ? (
<FloatingAction
showBackground={false}
actionsPaddingTopBottom={0}
actions={actions}
color="#1F62FF"
iconHeight={28}
iconWidth={28}
buttonSize={51}
floatingIcon={}
onPressBackdrop={() => null}
onPressMain={() => {
onCreateAction && onCreateAction();
}}
onPressItem={(name) => {}}
/>
) : (
<></>
)}

@ChronoByteCosmonaut
Copy link

Have had the same issue for quite some time, tried a lot of thing but nothing working as expected 🥲

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