PolymerElements / paper-dropdown-menu

A Material Design browser select element
https://www.webcomponents.org/element/PolymerElements/paper-dropdown-menu
61 stars 107 forks source link

Dropdown with 1 element in the list won't select if selected or default #157

Closed ljgww closed 8 years ago

ljgww commented 8 years ago

Description

Dropdown with 1 element in the list wont select the item if item is already selected or default selection is predefined in the code

Expected outcome

Closing the popup list

Actual outcome

Popup list stays

Live Demo

Steps to reproduce

<paper-dropdown-menu label="one?">
  <paper-listbox  class="dropdown-content"   attr-for-selected="value" selected="default" >
     <paper-item value="default">One with Default selection</paper-item>
  </paper-listbox>
</paper-dropdown-menu>                          

<paper-dropdown-menu label="one no default?">
   <paper-listbox  class="dropdown-content"  >
       <paper-item value="default">One no Default selection</paper-item>
   </paper-listbox>
</paper-dropdown-menu>
Stefdv commented 8 years ago

Yes...that's a problem for me too

bicknellr commented 8 years ago

As a workaround, you can listen for iron-activate and check the selection state + close the menu when that happens. Here's a demo.

valdrinkoshi commented 8 years ago

You can also listen to tap event on the paper-listbox and close the menu http://jsbin.com/fasagi/1/edit?html,output Anyways this issue doesn't belong here, it should go to paper-menu-button as it is the one controlling the close on selection change, so I'll move it there. I believe the current behavior is by design, a selection change should close the dropdown.

valdrinkoshi commented 8 years ago

This issue was moved to PolymerElements/paper-menu-button#85