Search code examples
polymerpolymer-3.x

What is a proper replacement of paper-menu and paper-submenu in Polymer 3?


I have a polymer 1 application that used paper-menu and paper-submenu. I am rewriting it in Polymer 3. What is the general consensus for its replacement? I have searched for this and have found nothing. It would be good if the documentation for paper-menu and paper-submenu showed its replacement.


Solution

  • I replaced paper-menu and paper-submenu with the Polymer 3 elements vaadin-accordion and paper-listbox

              <vaadin-accordion>
                <template is="dom-repeat" items="{{sources}}">
                  <vaadin-accordion-panel theme="filled">
                    <div slot="summary">[[item.name]]</div>
                    <paper-listbox>
                      <template is="dom-repeat" items="{{item.models}}">
                        <paper-item on-tap="selectModel">[[item.name]]</paper-item>
                      </template>
                    </paper-listbox>
                  </vaadin-accordion-panel>
                </template>
              </vaadin-accordion>