-
-
Notifications
You must be signed in to change notification settings - Fork 597
[6.x] Bring back responsive button groups #13336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Philipp Daun <[email protected]>
Signed-off-by: Philipp Daun <[email protected]>
Signed-off-by: Philipp Daun <[email protected]>
Signed-off-by: Philipp Daun <[email protected]>
Signed-off-by: Philipp Daun <[email protected]>
Signed-off-by: Philipp Daun <[email protected]>
Signed-off-by: Philipp Daun <[email protected]>
Signed-off-by: Philipp Daun <[email protected]>
Signed-off-by: Philipp Daun <[email protected]>
Signed-off-by: Philipp Daun <[email protected]>
Signed-off-by: Philipp Daun <[email protected]>
Signed-off-by: Philipp Daun <[email protected]>
|
Wouldn't it be better if the group fieldtype behaved the same way as the floating toolbar buttons? So instead of stacking and taking up more space, separating the buttons with some padding… I know it stacked in v5, but I think it's not the best solution as it takes up quite more space than it needs to. |
|
@andjsch I'd disagree. A gap between button group items would no longer communicate the nature of the input: it's basically a three-way toggle. You have to pick exactly one. Putting them in a single parent element with a common border shows that clearly. The floating toolbar on the other hand is a collection of actions. They're not exclusive, and not even strictly related in their function. So it doesn't have the constraint of having to show exclusivity. The distinction becomes clearer when removing the text. I've been working on icon-only versions of button groups lately. To differentiate an icon group (choose one) from icon toggles/checkboxes (choose any number), the gap/no-gap distinction is quite crucial.
If anything, I think that'd be an argument for introducing gaps in the floating toolbar at all sizes? |
|
Good points. Agreed 👍🏼 |

Somewhere on the way to v6, auto-stacking button groups went away. This PR brings them back and allows control over the behavior when buttons wrap to a second line:
orientation="auto"— switch to vertical layout when overflowing (used in fieldtype)gap="auto"— switch to normal buttons with gaps when overflowing (used in floating toolbar)overflow = 'stack' | 'gap'Closes #13072.
Button Group Fieldtype
Floating Toolbar
Required changes
orientationauto, it will switch between vertical and horizontal layout depending on overflow<ui-button-group orientation="auto">gapauto, it will switch between gaps and no gaps between buttons depending on overflow[data-floating-toolbar]special case since that's now justgap="auto"cvabecause of the inherent complexity