-
Notifications
You must be signed in to change notification settings - Fork 296
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
ListEmptyComponent can't use full height of view #848
Comments
can you leave an expo snack code example of the problem? |
Hi, we're facing exactly the same issue. Snack: https://snack.expo.dev/@picnic-harry/flashlist-listemptycomponent-flex-repro There are existing props for |
Facing this issue as well, currently working around it by manually setting the height of my Empty component to a percentage of the screen height, not ideal. |
Having the same issue here. Flex:1 on contentContainerStyle should fix it but it wont let me use it |
Having the same issue. |
Similar problem here. I need to center the ListEmptyComponent. Before migrating to FlashList |
the same issues here and using onLayout by view to measure height is so slow |
Flashlist doesn't support this, they only support a few basic padding properties, I think with EmptyComponent you should set a fixed height |
exactly the same here |
I really needed this one. Please have it!!!! |
Same problem here. :-/ |
have you tried checking if you list data is empty then displaying the empty component manually? |
Do we have any solution for this? if we use the Flatlist component from react Native is just add
can we implement something similar? |
need this please. |
I'm having the same problem |
Any update? |
Same Issue
EmptyView.tsx
|
This works perfectly! I can't imagine why it skipped my mind. Thanks 👍 |
same issue. |
pls fix this lol |
same issue. i decided to wrap EmptyView with View.
|
Anyone has a real solution for this problem ? ListEmptyComponent is unusable right now. |
Same Issue, I can't use another component if data is empty. I need ListHeaderComponent from it. Please fix it |
It is a common use-case to allow the empty content to be centered I guess. Currently I'm re-using the |
@naqvitalha Can we please get an official response on this? It is an extremely common use case to want to center the The way to achieve this with |
i have same issue, but how to handle keyboard open or closed to center in remaining place ? this is a very common case |
+1 same here, it require attention |
If you just want to render an empty view fitted to the height (without scrolling), you can cheat by using scrollEnabled based on data like this:
|
+1 |
Then you will loose pull to refresh when list is empty :(. The only way i managed to solve this is by using on layout. I created a hook:
Then in the component where i use the list:
So this is a workaround, the re renders caused by onLayout are minimal, cause of the useLayout hook and this measured property.
|
+1 |
Please refrain from "+1" comments. We all get notified. Just gives a thumbs up to the issue itself if you are affected. |
any updates here? any working workaround? |
still waiting for a solution in 2025 😕 |
I have given up on 'em. Hopefully, Legend list reaches v1 soon. I'm still very grateful for the library though |
Kind of crazy that one of the most basic / requested feature if still not implement without any activity from the shopify team whatsoever. @rKatex any plans for 2025? |
Current behavior
I need to render a
ListEmptyComponent
which uses the full height of the current view. To make this work with react nativesFlatList
I can apply acontentContainerStyle
withflex: 1
. Sadly this won't work with theFlashList
as it doesn't allowflex
in acontentContainerStyle
.flex
not allowed for forcontentContainerStyle
?contentContainerStyle
?Expected behavior
There should be the possibility to render
ListEmptyComponent
withflex: 1 / height: "100%"
To Reproduce
Use any
ListFooterComponent
and try to fill the whole view with it.Platform:
Environment
The text was updated successfully, but these errors were encountered: