statamic / cms

The core Laravel CMS Composer package
https://statamic.com
Other
4.11k stars 538 forks source link

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

Closed caseydwyer closed 1 week ago

caseydwyer commented 2 weeks ago

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!

caseydwyer commented 1 week ago

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 commented 1 week ago

I'll take the blame now if it does!