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

Create optgroup control inside the components package #17032

Closed
ferdiesletering opened this issue Aug 14, 2019 · 6 comments
Closed

Create optgroup control inside the components package #17032

ferdiesletering opened this issue Aug 14, 2019 · 6 comments
Labels
Good First Issue An issue that's suitable for someone looking to contribute for the first time [Package] Components /packages/components [Type] Enhancement A suggestion for improvement.

Comments

@ferdiesletering
Copy link
Contributor

In my project, I've created a custom optgroup control.

I was wondering maybe this could be a contribution to Gutenberg. The components package contains a select-control.

image

My considerations where:

  1. Add to the current select-control, which I think is impossible due to the data structure of the options parameter.
  2. Create a new control optgroup-control which has many similarities to the select-control

I would love to contribute and implement this feature. Before I start, I want to make sure this would be a useful contribution.

Any feedback is welcome

@swissspidy swissspidy added [Package] Components /packages/components [Type] Enhancement A suggestion for improvement. labels Aug 19, 2019
@JohnRDOrazio
Copy link
Contributor

JohnRDOrazio commented May 20, 2020

I would also like to see optgroup implemented for the SelectControl, perhaps when an array is supplied as the "value". See a similar discussion on the WP Customizer Controls here:
https://core.trac.wordpress.org/ticket/47692

I would integrate the functionality directly into the SelectControl to keep it consistent with HTML selects.

@swissspidy swissspidy added the Good First Issue An issue that's suitable for someone looking to contribute for the first time label Oct 18, 2020
@Ugoku
Copy link

Ugoku commented Jan 18, 2021

Bumping to avoid this issue being closed by the upcoming Stalebot

@t-hamano
Copy link
Contributor

t-hamano commented Apr 9, 2023

In #29540, the SelectControl component now supports children prop. This allows for the injection of optgroup elements.

I would like to close this issue as I believe it was resolved, but if I have missed something, please comment.

@t-hamano t-hamano closed this as completed Apr 9, 2023
@Ugoku
Copy link

Ugoku commented Apr 11, 2023

Just tested this in WordPress 6.2 and it appears to work perfectly! @t-hamano do you know in which Gutenberg version (or WP version) this was implemented?

@t-hamano
Copy link
Contributor

@Ugoku

#29540 was included as part of Gutenberg 11.8. And Gutenberg 11.8 is bundled with WordPress 5.9. Perhaps it was available starting with WordPress 5.9.

@Ugoku
Copy link

Ugoku commented Apr 11, 2023

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue An issue that's suitable for someone looking to contribute for the first time [Package] Components /packages/components [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

5 participants