vscode-elements / elements

Web component library for developing Visual Studio Code extensions
https://vscode-elements.github.io
MIT License
143 stars 27 forks source link

Single Select combobox improvements #200

Open mikeburgh opened 3 weeks ago

mikeburgh commented 3 weeks ago

For the combo box option, is it possible to enforce the entered value must match a provided value when using the native form validation.

Also, is it possible to get the ability to render an icon at the start of each value.

bendera commented 3 weeks ago

For the combo box option, is it possible to enforce the entered value must match a provided value when using the native form validation.

Currently, in combobox mode, it allows committing an invalid value that is not present in the list. In this case, the value will be an empty string, and the selectedIndex will be -1. This is definitely a bug. For validation, you can use the required attribute, which is the only applicable validation option for a select element. (I've just realized the validation is also buggy.)

Also, is it possible to get the ability to render an icon at the start of each value.

With the current implementation, it's only feasible with codicons. Would that be acceptable for you?

mikeburgh commented 3 weeks ago

Thanks, codicons will work.. I think I should be able to switch those for other icons easily enough post render if the need arises.

bendera commented 2 weeks ago

I've realized with the current implementation the performance is drastically degrading if icons are rendered in the options. It will be complex task. I can't estimate when it will be finished.

mikeburgh commented 1 week ago

No worries, I am getting around to seeing if I can patch it in after the render.. if I can I will close this as that will take care of my needs.