googlearchive / paper-menu

A Material Design menu
https://www.webcomponents.org/element/PolymerElements/paper-menu
27 stars 48 forks source link

Dynamically added paper-menu in paper-submenu disappears after opening in shady dom #108

Closed pprasse closed 7 years ago

pprasse commented 7 years ago

Description

In shady dom mode, when a paper-menu is added to a paper-submenu dynamically (via dom-template or document.createElement) after the paper-submenu is open, the complete added paper-menu disappears if you try to click one item of the paper-menu.

Expected outcome

There should be no difference between a dynamically added paper-menu in shadow DOM and shady DOM and the added paper-menu should not disappear.

Actual outcome

The paper-menu disappears completely from the DOM tree in shady dom after it is clicked or even looses focus

Live Demo & Steps to reproduce

Shady DOM (with bug)

Please run the example in https://jsfiddle.net/pprasse/qgfknpdy/10/

  1. Click on one menu item (for example "bla")
  2. after 500ms a new submenu item appears ("label1")
  3. try to click the new item (or anywhere else on the page)
  4. complete paper-menu in paper-submenu "disappeared"

Shadow DOM (without bug)

Please run the example in https://jsfiddle.net/pprasse/qgfknpdy/9/

  1. Click on one menu item (for example "bla")
  2. after 500ms a new submenu item appears ("label1")
  3. try to click the new item (or anywhere else on the page)
  4. works as expected, no problems.

Browsers Affected

pprasse commented 7 years ago

Works with polymer 2.0