Error raised in _onTap function for removed elements actioned by tap events
When removing a child element from a drawer, the following error raised:
Uncaught TypeError: targetElement.hasAttribute is not a function
just added one more condition to if clause in line 502 so it doesn't happened anymore.
_onTap: function(event) {
var targetElement = Polymer.dom(event).localTarget;
var isTargetToggleElement = targetElement &&
this.drawerToggleAttribute && targetElement.hasAttribute &&
targetElement.hasAttribute(this.drawerToggleAttribute);
if (isTargetToggleElement) {
this.togglePanel();
}
},
It's a minor issue, maybe caused by a bubbling event after element has been removed, but you should look into this.
hmm. so what is targetElement if it's not an element with hasAttribute? Would you mind sending a code that reproduces this issue?
when the element is dynamically removed from dom, the object received in this function is window, that does not provide a method hasAttribute.
I'll send you a code to reproduce this issue.
cc @azakus. Is it possible for Polymer.dom(event).localTarget to return window in the case described above?
friendly ping @azakus
Any news for this bug?
We can see this bug in polymer-element-catalog project. For example, in this page: https://elements.polymer-project.org/browse?tag=live&view=cards
When we click on a tag (for example "live") we has this error: "TypeError: Argument 1 of Node.contains does not implement interface Node."