Skip to content

[LiveComponent] Update css to cover more data-loading use cases #2891

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

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from

Conversation

barlito
Copy link

@barlito barlito commented Jul 2, 2025

Q A
Bug fix? yes
New feature? no
Docs? no
License MIT

This update fixes the default display of loaders in Live Components by extending the CSS selector to also target attributes like data-loading="action(saveForm)|show" or data-loading="delay(500)|show" or even both combined.
This ensures that loaders remain hidden on initial render or dynamic component insertion, preventing unwanted visual flashes or unwanted displaying of the element that should not be displayed.

Example
Previously, an element like
<span data-loading="action(save)|show">Loading…</span>
could be visible in some cases, like loading a new stimulus controller when the component refresh.
It doesn't change the previous behavior, it just covers more cases.

@carsonbot carsonbot added Bug Bug Fix LiveComponent Status: Needs Review Needs to be reviewed labels Jul 2, 2025
Copy link
Contributor

github-actions bot commented Jul 2, 2025

📊 Packages dist files size difference

Thanks for the PR! Here is the difference in size of the packages dist files between the base branch and the PR.
Please review the changes and make sure they are expected.

FileBefore (Size / Gzip)After (Size / Gzip)
LiveComponent
live.min.css 78 B / 81 B 74 B-5% 📉 / 80 B-1% 📉

Copy link
Member

@Kocal Kocal left a comment

Choose a reason for hiding this comment

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

LGTM

@carsonbot carsonbot added Status: Reviewed Has been reviewed by a maintainer and removed Status: Needs Review Needs to be reviewed labels Jul 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug Fix LiveComponent Status: Reviewed Has been reviewed by a maintainer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants