playcanvas / pcui

UI component library for web-based tools
http://playcanvas.github.io/pcui
MIT License
664 stars 62 forks source link

SelectInput: disable options #307

Closed ellthompson closed 1 year ago

ellthompson commented 1 year ago

The PR adds support for disabling certain options in the SelectInput and allowing the SelectInput to fall back to another option if the currently selected value is set as disabled. Upon removing the previously selected value from the disabled options, it should be restored as the SelectInput's current value.

Also includes support for a pretext argument that can be passed into the SelectInput class. This adds text to the beginning of the selected value, as shown here:

image

Each disabled option can be given new text to display when disabled. The SelectInput also now visually indicates both the user selected (but now disabled) option and the fallback option when displaying its list of options:

image