HubSpot / react-select-plus

Fork of https://github.com/JedWatson/react-select with option group support
http://github.hubspot.com/react-select-plus/
MIT License
286 stars 93 forks source link

Option to hide option group label #44

Open thienanle opened 8 years ago

thienanle commented 8 years ago

So that if I have a list like below, I can hide "Fruits" and have the "All fruits" option act as the label for that group.

All fruits
Fruits <-- option to hide this
    Apples
    Oranges
    Mangos

Another solution would be to make the option group label selectable.

yarnball commented 7 years ago

Did you have any success with this?

I am also trying to modify the Group label- as I'd like to make a section of it clickable. But I the part of the code where it is handled- been looking through 'Select.js' for days.

I would like to make the label have a clickable value next to it (so you can choose to the group label value IF you want, a value below it). How would I do this?

This is the group label as far as I can tell- https://github.com/HubSpot/react-select-plus/blob/master/src/Select.js#L602

FWIW, you can change the css of the top & bottom using:

.Select-option-group-label ~ .Select-option-group {
  #
}

.Select-option-group-label ~ .Select-option {
 #
}