Skip to content

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

Merged
Kocal merged 1 commit into
symfony:2.xfrom
barlito:live-css-update-data-loading
Jul 6, 2025
Merged

[LiveComponent] Update css to cover more data-loading use cases#2891
Kocal merged 1 commit into
symfony:2.xfrom
barlito:live-css-update-data-loading

Conversation

@barlito

@barlito barlito commented Jul 2, 2025

Copy link
Copy Markdown
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
@github-actions

github-actions Bot commented Jul 2, 2025

Copy link
Copy Markdown
Contributor

📊 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% 📉

@Kocal Kocal left a comment

Copy link
Copy Markdown
Member

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
@Kocal

Kocal commented Jul 6, 2025

Copy link
Copy Markdown
Member

Thank you @barlito.

@Kocal
Kocal merged commit 1236188 into symfony:2.x Jul 6, 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