Closed neon64 closed 8 years ago
I have managed to track this down to https://github.com/PolymerElements/paper-behaviors/blob/master/paper-ripple-behavior.html#L84. When the actual shadow DOM is used, the Node.contains
test fails because <paper-button ....>
is not inside #shadow-root
.
If I change that line:
if (domContainer.contains(/** @type {Node} */(target))) {
To this:
if ((domContainer.host != undefined && domContainer.host == target) || domContainer.contains(/** @type {Node} */(target))) {
Then it appears to work on the first click. However I feel that that is a rather 'hacky' solution.
Mmm, this doesn't work if the target is a an element (eg: <iron-icon>
) inside the <paper-button>
not the button itself
Thanks for the thorough assessment of the problem. I will take a look.
Can't seem to reproduce this issue anymore - going to close this issue. Feel free to reopen if you still see it.
The first time a click a
<paper-button>
, there is no ripple. The next time I click it there is. It seems this only exists when I use Chrome's native shadow DOM (using?dom=shadow
).This can be tested by loading the demo page for this element using the native shadow DOM.