RE: Combobox

Do you need to have text input enabled in the ComboBox at all? You can disable it by using setTextInputEnabled(false).


Hi everyone,

I’ve got a weird behaviour and I don’t know how to avoid this.
I’ve got a form with a combobox and I’ve got a button with shortcut key.
If I call the button action when the combobox has the focus then the content of the combobox is filtered.
The user has to click on the combobox arrow (“v”) or clear the combobox.

Here an example of my problem.
Steps to reproduce: select “first” in the combobox, tap F12
The behaviour is different is the user click on the button.

public class MyUI extends UI {

protected void init(VaadinRequest vaadinRequest) {
final Binder<Person> binder = new Binder<>(Person.class);
Person p = new Person();
VerticalLayout layout = new VerticalLayout();
TextField name = new TextField("Name");
ComboBox<String> rank = new ComboBox<>("combo");

Button saveButton = new Button("Save", e -> {"save OK", Notification.Type.HUMANIZED_MESSAGE);
binder.forField(rank).bind(Person::getRank, Person::setRank);
binder.forField(name).asRequired("Required").bind(Person::getName, Person::setName);
binder.readBean(new Person());

public class Person {
private String name;
private String rank;
public String getName() {
return name;

public void setName(String name) { = name;

public String getRank() {
return rank;

public void setRank(String rank) {
this.rank = rank;

@WebServlet(urlPatterns = "/*", name = "MyUIServlet", asyncSupported = true)
@VaadinServletConfiguration(ui = MyUI.class, productionMode = false)
public static class MyUIServlet extends VaadinServlet {



Is there any workaround ?


I don’t need to add new item in the combobox but I need to filter inside the combobox.

With setTextInputEnabled(false), you cannot use keyboard (nativeSelect is better in this case).

EDIT: Thanks for your answer :). For simple combobox, it’s a good workaround but my 3-items combo is just an example. I really need this filter.

Ah, it’s a known issue, then. There’s even a sample project to reproduce the issue included in the GitHub ticket.


There is a opened bug for that
In fact, my problem is not related to the shortcut key on the button.

When I use key like F12 (or CTRL-A or “Left”) then the combobox filters all elements except the selected item.

You can see the difference between Vaadin framework combobox and vaadin elements combobox.
Choose a country (or Helium element :stuck_out_tongue: ), type “Left” on your keyboard.