Fix button with icons but empty slot rendered as square button - #2821
Open
ghabriel25 wants to merge 1 commit into
Open
Fix button with icons but empty slot rendered as square button#2821ghabriel25 wants to merge 1 commit into
ghabriel25 wants to merge 1 commit into
Conversation
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.
Summary
Fix flux button with icons but no slot content rendered as square button
Problem
Buttons with both
iconandicon:trailingbut no text content were incorrectly rendered as square buttons when Blaze was disabled/enabled.This happens because an empty/whitespace-only slot is treated as empty by the compiled view, causing
$squareto default totrue. As a result, the button receives the square styling (w-8for small button) and the two icons lose their expected spacing and overlap.Solution
Only default the button to square when the slot is empty and the button does not contain both a leading and trailing icon.
This preserves the existing square-button behavior for icon-only buttons while ensuring buttons containing two icons are rendered with the correct spacing, regardless of whether Blaze is enabled.
Before
After
Setup
Note
Notice that the first button with whitespace slot rendered slightly different when Blaze disabled and enabled. It seems Blaze treat whitespace differently therefore I'll just keep it as it is.
Blaze Off
Before:

After:

Blaze On
Before:

After:

Related PR: livewire/blaze#209
Fixes #2816