Fix button group styling when buttons are wrapped in tooltips#2404
Open
joshhanley wants to merge 1 commit intomainfrom
Open
Fix button group styling when buttons are wrapped in tooltips#2404joshhanley wants to merge 1 commit intomainfrom
joshhanley wants to merge 1 commit intomainfrom
Conversation
This was referenced Feb 17, 2026
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.
The Scenario
When a button with a tooltip is placed inside a
<flux:button.group>(typically via a<flux:modal.trigger>), the button visually breaks out of the group — the border radius isn't welded together and the borders don't collapse properly, making it appear as a separate disconnected button.This happens with both the
tooltipprop on the button and the<flux:tooltip>component wrapper.The Problem
The button group component uses CSS child selectors to weld buttons together by overriding border-radius and collapsing borders. It handles three nesting depths:
[&>[data-flux-group-target]:first-child...]— buttons directly in the group[&>*:first-child>[data-flux-group-target]...]— button inside one wrapper (e.g., a<flux:modal.trigger>withdisplay: contents)[&>*:first-child>[data-flux-input]>[data-flux-group-target]...]— button inside two wrappers (e.g., combobox)When a tooltip wraps a button inside a
<flux:modal.trigger>, the DOM structure becomes:The
<flux:modal.trigger>usesdisplay: contentsso it's invisible to layout, but CSS selectors still see it in the DOM tree. The one-level selectors don't match because the button isn't a direct child of the modal trigger — the<ui-tooltip>element sits between them. And the two-level selectors only target[data-flux-input]as the intermediate element, not[data-flux-tooltip].The Solution
Added targeted
[data-flux-tooltip]selectors to bothbutton/group.blade.phpandinput/group/index.blade.php, mirroring the existing[data-flux-input]pattern for two-level nesting:This specifically matches the
wrapper > tooltip > buttonpattern using child combinators (>) at each level, so it won't affect buttons nested deep inside menus, dropdowns, or popovers within the group — avoiding the issue with the previous approach of using descendant selectors.Fixes #2021