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

[5.x] Enhancement: Make button groups clearable #11110

Merged

Conversation

caseydwyer
Copy link
Contributor

This PR makes two small adjustments to the Button Group fieldtype:

  1. Adds a clearable option to the config. When enabled, this works like the Select fieldtype but without a dedicated ✖ button. Instead, you can now just click the currently-selected option to deselect it.
  2. Previously, hovering anywhere to the right of grouped buttons (ie, in the blank, unused space after the group) would show a pointer cursor, as if there was an invisible button. Quick little CSS patch on the wrapper to use cursor-default instead.

Let me know if there are any edits I can help with, here!

Copy link
Member

@jasonvarga jasonvarga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good find on the css. I adjusted it so that it removes the cursor globally. It doesn't need to be there as it gets applied to the buttons inside anyway.

@jasonvarga jasonvarga merged commit 0323f2b into statamic:5.x Nov 12, 2024
16 checks passed
@caseydwyer
Copy link
Contributor Author

caseydwyer commented Nov 12, 2024

I adjusted it so that it removes the cursor globally

Ahh, nice—I wondered if that was the right approach, but was afraid it might break things elsewhere. Thanks Jason!

@jasonvarga
Copy link
Member

I'll take the blame now if it does!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants