paper-dropdown-menu
paper-dropdown-menu copied to clipboard
reset functionality?
How do you reset paper-dropdown-menu to its original state?
<paper-dropdown-menu label="Choose...">
<paper-listbox class="dropdown-content">
<paper-item>allosaurus</paper-item>
<paper-item>brontosaurus</paper-item>
<paper-item>carcharodontosaurus</paper-item>
<paper-item>diplodocus</paper-item>
</paper-listbox>
</paper-dropdown-menu>
I tried setting the selected property to null, that doesnt seem to work.
try setting contentElement.selected to null. Seemed to work for me. What you're doing, is changing the selected property of the paper-listbox element, since paper-dropdown-menu doesn't have a selected property.
Pretty strange that there is no programmatic way to select an item - would this not be considered to be a desirable thing?
add selected to the paper-listbox and update the selected value to the index value you want selected.
<paper-listbox selected="{{selected}}">
this.selected = 2;
that worked for me...