vaadin combobox in polymer 3

62 Views Asked by At

I have following code to use vaadin combo box in polymer 3, but itis not working.

<vaadin-combo-box id ="select" placeholder="Please select">
  <template is="dom-repeat" items="{{items}}" as="item">
  <option value$="{{item.id}}">&nbsp;&nbsp;{{item.type}}</option>
</vaadin-combo-box>

I understand, it has to do with and , else if I just use exact values in items, it works

1

There are 1 best solutions below

1
Tatu Lund On

You should not use template with dom-repeat. There is internal logic that populates the popup with vaadin-item's based on items property (note, it does not use option), so it should be enough if you do

<vaadin-combo-box
  label="Type"
  placeholder="Please select"
  item-label-path="type"
  item-value-path="id"
  items="{{this.items}}"
></vaadin-combo-box>