Skip to content
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

v2: role "group" on buttons #417

Open
gp-slick-coder opened this issue Nov 6, 2023 · 6 comments
Open

v2: role "group" on buttons #417

gp-slick-coder opened this issue Nov 6, 2023 · 6 comments
Labels
help wanted Extra attention is needed v2

Comments

@gp-slick-coder
Copy link

image

I'm not so sure if this is useful. This is totally against good UX.

@lucaslarroche
Copy link
Member

@gp-slick-coder, do you recommend updating the docs? Or removing the feature (not possible now to avoid a breaking change).

I guess it could be useful for a group of related actions, like:
image

@gp-slick-coder
Copy link
Author

Sorry for my bad description. The feature is useful. The only issue is with the focus of the button(s).

Current behavior: On a button click, all buttons will be "focused" (as shown in the previous image).

Expected behavior: On a button click, only the button that was clicked, should be focused.

Good examples:
https://efrolic.github.io/css//button-group
https://bulma.io/documentation/elements/button/#button-addons
https://picturepan2.github.io/spectre/elements/buttons.html#buttons-groups
https://getbootstrap.com/docs/4.0/components/button-group/

@lucaslarroche
Copy link
Member

Ah, yes, I get it.

I think this style looks broken/buggy:
Screenshot 2024-02-13 at 23 17 21
Screenshot 2024-02-13 at 23 18 09
Screenshot 2024-02-13 at 23 24 46

I still prefer this style:

Screen.Recording.2024-02-13.at.23.21.11.mov

But I'm open to a better solution.

@lucaslarroche lucaslarroche added the help wanted Extra attention is needed label Feb 13, 2024
@Brian-Pob
Copy link

What about something like this where the whole border of the button in the group is shown instead of a broken border?

CleanShot.2024-02-17.at.01.40.44.mp4

Example from:
https://stackoverflow.com/a/67756667

@fadrian06
Copy link

I am having overflow problems on mobile

Screenshot_20240217-132912.png

The third button of the group leaves the container

@Brian-Pob
Copy link

The issue with the button group overflowing seems to be due to this style rule setting a new horizontal padding of 2rem, which overrides the original horizontal padding of 1rem.

[role=group] [role=button], [role=group] [type=button], [role=group] [type=submit], [role=group] button, [role=search] [role=button], [role=search] [type=button], [role=search] [type=submit], [role=search] button {
    --pico-form-element-spacing-horizontal: 2rem;
}

image

It seems that keeping the padding at 1rem still looks decent while allowing the display to get as small as 306px (smaller than an iPhone SE at 375px) without any overflow issues. See attached screen recording

Recording.2024-02-18.162102.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed v2
Projects
None yet
Development

No branches or pull requests

4 participants