polymer paper-dropdown-menu unable to set selected item

387 Views Asked by At

I am trying to use the paper-dropdown-menu and paper-listbox like a select input field which should automatically set the update the value of the field upon selection.

<paper-dropdown-menu label="Offense">
         <paper-listbox slot="dropdown-content" class="dropdown-content" attr-for-selected="value" selected="{{player.position}}" fallback-selection="N-None">
           <paper-item value="WR-Wide Receiver">WR-Wide Receiver</paper-item>
           <paper-item value="ATH-Athlete">ATH-Athlete</paper-item>
           <paper-item value="N-None">N-none</paper-item>
         </paper-listbox>
</paper-dropdown-menu>

But upon selection, the dropdown refuses to disappear enter image description here

The offical docs don't seem to mention how to use the two of them together to use like a select field.

1

There are 1 best solutions below

0
On

Have you tried using an attribute name different from value?

I have experienced issues with certain attribute names that are defined in the HTML specs. Try testxyz instead of value as attribute name and see if that works for you.