googlearchive / paper-tabs

A tabs à la Material Design
22 stars 21 forks source link

Setting textContent of paper-tab triggers PaperRippleBehavior #75

Closed jasmith79 closed 8 years ago

jasmith79 commented 8 years ago

Changing the textContent of a paper-tab triggers the paper-ripple animation but throws an error seemingly because the context is incorrect:

//relevant line from paper-ripple.html (565):
if (this.parentNode.nodeType == 11) { //this.parentNode is null

triggered by

document.querySelectorAll('paper-tab')[0].textContent = 'foo';

Using innerHTML instead of textContent has the same problem. I've worked around the issue by putting a span inside the tabs to change the content of. I realize that I could avoid all this by using data-binding, but its really overkill for simple cases. Is triggering the PaperRippleBehavior on content change the desired behavior? Does it somehow focus the element?