Combobox: Option to render html element inside selected item #953
-
Hello team The combobox supports Here is the code sample: https://codesandbox.io/s/combobox-hqy2v |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @kalaindrek There is a constraint that we are adhering to with the Combobox, and that is it's an HTML input element that stores the value. As such we are limited to what an HTML input element can display as a value, it can only display strings. You can get the first part fairly easily by updating the
Where you concat the item and value together into a single string to display. We just can't support displaying an icon (or anything other than a string) as part of the displayed value. Hope that answers your question. |
Beta Was this translation helpful? Give feedback.
Hi @kalaindrek
There is a constraint that we are adhering to with the Combobox, and that is it's an HTML input element that stores the value. As such we are limited to what an HTML input element can display as a value, it can only display strings.
You can get the first part fairly easily by updating the
itemToString
method you supplyWhere you concat the item and value together into a single string to display.
We just can't support displaying an icon (or anything other than a string) as part of the displayed value.
Hope that answers your question.