Vaadin 8 ListSelect does not allow anymore single selection

I did not find any way to limit the ListSelect in Vaadin 8 to be in a single selection mode?

If this is the case, looks to me to be serious regression compared to Vaadin 7. Even if we can use a ComboBox instead, that’s definitively not the same froma UI perspective.


With 8.1.0 and newer, you can use NativeSelect and setVisibleItemCount(5) to get something which looks like a ListSelect but is in single select mode

Another option is RadioButtonGroup. If it’s too long, you can put it into scroolable panel.

Thanks, but both are not exactly the same in term of UI appearance. As I don’t want change to change the look of the widget (the product is already used and many people do not like “unnecessary change” on UI), will propably have to go managing the selection by myself, but I do not see any valid reason for removing the feature.

NativeSelect with setVisibleItemCount(5) should look the same as a ListSelect. Where does it differ?

A ListSelect adapt its size to the layout, which is not the case if you use something like setVisibleItemCount(5).
For the RadioButtonGroup, the difference is even more visual.

You can see on e.g that if you set itemCount to 2 and height to 100px, then it will be a 100px high select showing 4 options, i.e. height overrides itemCount

Oh yes, indeed. Thanks for the tips. It was just a little surprising to start from another component to reach my expected list select.
But I know how documentation may be hard to write.

Thanks for your patience.