Apply attributes to the root element of text separators#2675
Open
calebporzio wants to merge 1 commit into
Open
Apply attributes to the root element of text separators#2675calebporzio wants to merge 1 commit into
calebporzio wants to merge 1 commit into
Conversation
When a separator has text, the attribute bag was forwarded to the two inner line divs instead of the component's root element. Directives like wire:transition ended up on the lines, so the lines animated but the text (and the element itself) did not. Apply the attribute bag to the root container instead, and leave the line divs as internal decoration. Fixes #2555 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2555
When a separator has
text, the attribute bag was forwarded to the two inner line<div>s instead of the component's root element. Sowire:transitionlanded on the lines — each line got its own view-transition snapshot and faded, while the container and the text span rode along with the root (whose fade Livewire intentionally disables) and popped in instantly.This applies the attribute bag to the root container instead, and leaves the line divs as internal decoration. Now the whole separator — lines and text — animates as one group:
renders as:
This also puts
id,data-*, and other passthrough attributes where you'd expect them. Note the one behavior change: custom classes on a text separator now merge onto the root container rather than the two line divs — consistent with how every other component applies its attribute bag to the root element (the plain andverticalvariants are untouched).Verified in a real Livewire v4 app with Playwright: before, mid-transition the buttons and lines were half-faded while the "or" text was at full opacity; after, the separator (text included) receives the
view-transition-nameand fades with everything else.🤖 Generated with Claude Code