Fix button group with modal trigger #2048
Draft
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
Currently if you have a button group, with buttons that have both a tooltip and are a modal trigger, then the buttons borders aren't rendered correctly to match the group.
The problem
The issue is that the CSS selectors which remove the rounded and excess borders on inner buttons is scoped to only apply these styles for immediate children of the button group. There are also selectors which account for a button group with a tooltip that contains a button (1 level of nesting).
But when using a modal trigger, the button itself ends up a few levels below the button group in the DOM and as such isn't being targeted by the child selectors.
The solution
The solution is to update the selectors to detect any buttons within the group and apply the correct styles.
So for example, this PR changes the selector from:
To
The main difference is before the
[data-flux-group-target]instead of a>which is direct children, we now use_which means any children.One bonus we get by making this change is we had a selector for
sub-sub-children of input groupswhich is now no longer needed as it is covered by these selector changes.Now it all works as expected.
I also added this scenario to our
groupstest page and checked all the other groups still worked as expected.Fixes #2021
Fixes #2072