The pop-up menu widget NativeSelect
in Vaadin 8 displays a list of the possible items along with an empty slot at top, presumably to indicate “no item yet chosen”.
How can I disable that empty slot, forbid empty selection?
In preparing the layout, I will set one of the items as chosen by default. The user then is required to always choose one. I want to forbid the no-item-selected case.
To remove that empty item from the dropdown, call NativeSelect::setEmptySelectionAllowed
:
nativeSelect.setEmptySelectionAllowed(false);