-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[BUG] - Table: specifying both emptyContent and loadingContent shows both of them while content is loading #2470
Comments
Avoid displaying loadingContent and emptyContent at the same time.
Thank you @alphaxek. Yes, that helps, and I already used something like that. I would expect the framework to take care of that for me though. |
Hi @jrgarciadev @tianenpang @wingkwong, Is this issue supposed to be handled on client side or by framework itself? |
IMO empty content and loader shouldn't be shown at the same time. @brunokc I've seen you changed something already. Can you make a PR? |
@wingkwong yes correct both shouldn't be shown, but is it a client side issue or framework issue? |
I think it should be handled by the framework. Users shouldn't add such logic themselves. |
Awesome, I'll work on that PR shortly. Thanks, everyone! |
@brunokc If your query is resolved please mark as answered, will appreciate, thanks! |
Avoid displaying loadingContent and emptyContent at the same time. Note that there's an existing issue with loadingContent where if emptyContent is not provided, it will render loadingContent on top of the columns (instead of inside the table). This change doesn't fix that, but rather make isLoading play nice with a provided emptyContent. A separate fix is still needed for when emptyContent is not provided, which may affect this change later.
Sorry for the delay. I ran into the other issue I mentioned where |
Avoid displaying loadingContent and emptyContent at the same time. Note that there's an existing issue with loadingContent where if emptyContent is not provided, it will render loadingContent on top of the columns (instead of inside the table). This change doesn't fix that, but rather make isLoading play nice with a provided emptyContent. A separate fix is still needed for when emptyContent is not provided, which may affect this change later.
NextUI Version
2.2.9
Describe the bug
If I'm loading data dynamically, and use both
loadingContent
andemptyContent
, NextUI seems to show both of them whileisLoading
istrue
and then either keepemptyContent
if I get nothing back, or both of them disappear if the API returns actual content.Tangential to this, you'll also notice that when there's no
emptyContent
defined anditems
is empty ([]
), the loading element will be rendered on top of the columns. I think it's missing a minimumheight
in its definition.Your Example Website or App
https://stackblitz.com/edit/nextui-table-bug
Steps to Reproduce the Bug or Issue
Expected behavior
loadingContent and emptyContent should be mutually exclusive. While loadingContent is being rendered, emptyContent should not be used, and vice-versa.
Screenshots or Videos
No response
Operating System Version
Windows
Browser
Edge
The text was updated successfully, but these errors were encountered: