Search code examples
javacomboboxvaadinvaadin8

How to remove the button in Vaadin 8 ComboBox?


I'm looking to remove the little chevron to the right of the Vaadin ComboBox -- the one I marked with blue in the image:

enter image description here

I'm looking to remove it completely from one specific instance of the ComboBox and i don't need to make it appear again in some cases on that ComboBox.

The ComboBox should be otherwise functional the same way -- show options in dropdown as the user types, disallow null selection, etc.

How can this be done?


Solution

  • Luckily the button has class name in CSS, "v-filterselect-button". So I recommend to try following, add style name to your combobox, so that you can target the specific instance

    combobox.addStyleName("my-combo")
    

    And in your theme mixin in your theme SCSS file add following

    .my-combo .v-filterselect-button {
      display: none;
    }
    
    .my-combo .v-filterselect-input {
      padding-right: 0px;
    }