Custom components as dividers in (MultiSelect)ComboxBox

For ComboxBox, is there any option to add a component between the value that is non-selectable. I want to show the topic of the items below like Employee, Group, Role.
Like with the Select where dividers can be added.

Here with the ComboxBoxRenderer, but the item is still selectable:

Here’s an older post with a potential solution: Vaadin 14 combo box with nonselectable separators.

So basically, implement a renderer that can distinguish between group labels and items, and then use CSS to make sure that group labels are not clickable. One downside I can see is that group labels are still selectable using keyboard navigation. You’ll also want to pay attention to the filtering logic to make sure that a group label is still visible if one of its items matches.

1 Like