Our client has a use case where he wants to be able to select multiple items represented by Vaadin icons inside a combo box. We want the selected values to be also rendered in the input field as icons instead of a text. This particular combo box is going to be used as multi item filter for grid.
Below is a picture of our current ComboBox which renders text.
I thought about using HasPrefix interface to manually set these icons (grouped by Span) whenever the selection change.
I have found out that extending Vaadin’s MultiSelectComboBox with interface HasPrefix allows us to put prefix slot inside it’s element. The missing thing is to be able to put <slot name="prefix" slot="prefix"></slot> inside a <vaadin-multi-select-combo-box-container part="input-field"> as it is in a regular ComboBox
How to achieve this?
Below is a picture of something similar that we would like to achieve but using emojis put into strings.
I went with a different hacky solution though it is not perfect.
I set the background color of labels to their coresponding statuses and styled the label to look like a circle. I do not display any text for them except for the light green status with i. The items in the dropdown are still rendered as VaadinIcons Pic below .
The problem is that even though selected chip/labels would fit in the input field they are collapsed into this gray overflow chip. Is it possible to change this behaviour so that every chip/label is always displayed if they would fit?