简体   繁体   中英

How to use paper-dropdown-menu to select multiple items?

Is there a way use paper-dropdown-menu to let the user select multiple items when the dropdown opens and then close it by tapping outside of it? Currently, the dropdown closes each time one item is tapped. I think this question is similar to this one, but I do not understand how to proceed with the solution mentioned there. Thanks!

<paper-dropdown-menu label="General">
  <paper-dropdown class = "dropdown">
     <core-menu class = "menu"  multi>
        <paper-item name = "item1">item1</paper-item>
        <paper-item name = "item2">item2</paper-item>
        <paper-item name = "item3">item3</paper-item>
     </core-menu>
  </paper-dropdown>
</paper-dropdown-menu>

I think paper-dropdown-menu/ core-dropdown-menu isn't for your case. Because they always toggle state. But you can open menu manually as in this (openDropdown function)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM