Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Add support for disabled drop down items in SelectControl #15976
Fixes #11270. Adds support for marking options within a
How Has This Been Tested?
Screenshots (jpeg or gifs if applicable):
Types of changes
This changes improves an existing component and updates one use of that component to demonstrate how it can be used.
aduth left a comment
It's not clear to me: What's the purpose of the "- Select -" option existing at all? My initial worry was that the block allows for the value to be "unset", which we'd regress on with the changes here. But the behavior from choosing the value seems to be invalid (displays a message "Your site has no tags"). Perhaps it's meant as a fallback condition for sites with no taxonomies registered?
It's to provide a default option as a placeholder, so that it doesn't look to the user as though the first option is selected - it hasn't, if you check the value of the select.
This won't happen - the initial value is
It's for anywhere that a dropdown is used and the list of
One way you can test this is to create a simple block with a drop down in the block controls. Give the drop down a single value. At the moment, the result would be that it looks to the user as though that single option is selected. If you use JS to get the value of the select, it will be empty (so not what the user sees). If the user attempts to select that single option, nothing actually happens - the value never changes.
Thanks for working on this! No objections from me in having the ability to disable an option.
Not sure about the specific usage on the Tag Cloud taxonomy select. One of the taxonomies must be always selected, so I'm not sure I understand what is the purpose of the
Jul 31, 2019
1 check passed
That sounds like a bug in the code, which is assuming a state change
Will create a new issue...