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(table): hide empty content if isLoading is true (#2470) #2491

Merged

Conversation

brunokc
Copy link
Contributor

@brunokc brunokc commented Mar 10, 2024

Closes #2470

📝 Description

This change ensures that emptyContent is hidden if isLoading is true

⛳️ Current behavior (updates)

Currently, if loadingContent and emptyContent are both provided, and isLoading is true, NextUI will render both of them on top of each other.

🚀 New behavior

This change suppresses the rendering of emptyContent if isLoading is true.

💣 Is this a breaking change (Yes/No):

No.

📝 Additional Information

Note that there's an existing issue with loadingContent where if emptyContent is not provided, NextUI will render loadingContent on top of the columns (instead of inside the table). This change doesn't fix that, but rather make isLoading/loadingContent play nice with a provided emptyContent. A separate fix is still needed for when emptyContent is not provided.

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.
Copy link

changeset-bot bot commented Mar 10, 2024

⚠️ No Changeset found

Latest commit: ad15d05

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

Copy link

vercel bot commented Mar 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nextui-storybook-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 10, 2024 1:47am

Copy link

vercel bot commented Mar 10, 2024

@brunokc is attempting to deploy a commit to the NextUI Inc Team on Vercel.

A member of the Team first needs to authorize it.

@brunokc
Copy link
Contributor Author

brunokc commented Mar 10, 2024

Hi @jrgarciadev @tianenpang @wingkwong,

This change seems to be enough for isLoading and emptyContent to play nice in my scenario, where both are supplied. However, I had to change my original fix so that loadingContent renders in the right place (inside the table instead of on top of the columns), but that only works if emptyContent is provided.

I'm not sure this is acceptable. I intended to fix the "loadingContent without emptyContent" rendering issue but I don't know enough about the framework to propose a fix. I'd be happy to follow your guidance and try to fix it, if you have any suggestions.

Copy link
Member

@jrgarciadev jrgarciadev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! @brunokc

@jrgarciadev jrgarciadev merged commit 5a8768a into nextui-org:main Mar 10, 2024
7 of 8 checks passed
@alphaxek
Copy link
Contributor

Hi @jrgarciadev @tianenpang @wingkwong,

This change seems to be enough for isLoading and emptyContent to play nice in my scenario, where both are supplied. However, I had to change my original fix so that loadingContent renders in the right place (inside the table instead of on top of the columns), but that only works if emptyContent is provided.

I'm not sure this is acceptable. I intended to fix the "loadingContent without emptyContent" rendering issue but I don't know enough about the framework to propose a fix. I'd be happy to follow your guidance and try to fix it, if you have any suggestions.

I will raise PR for this

@brunokc brunokc deleted the fix/table-empty-content-while-loading branch March 10, 2024 21:10
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.

[BUG] - Table: specifying both emptyContent and loadingContent shows both of them while content is loading
3 participants