Vaadin 14 disable text inline editing in a combobox component

Viewed 20

I am using a combobox in a webapp with Vaadin 14. When the user clicks into the textfield, he can enter text. I do not want that. The values of the combobox itself should not be editable, but the user should still be able to select the predefined values. This is the standard behaviour of these components. How to do that in Vaadin 14.6.8?

2 Answers

The solution I found on the internet (on the feature request site):

cb.getElement().setAttribute("onkeydown", "return false");

It works partially, the cursor keeps blinking in the textfield, but custom user input is disabled.

Related