typeError: Failed to execute 'contains' on 'Node': parameter 1 is not of type 'Node Polymer

纵饮孤独 提交于 2019-12-10 16:59:35

问题


I am trying to implement context menu using polymer paper menu. Whenever I remove node from dom. polymer is throwing error like this

typeError: Failed to execute 'contains' on 'Node': parameter 1 is not of type 'Node'

and I get the following error message:

What shall I do?


回答1:


I had the same issue. This is due to polymer-mini.html checks if the arg passed to document.documentElement.contains(node) is node type. Debugging i could see that an event propagated so the last iteration was window object causing this issue. My solution was adding ev.stopPropagation() to the code before removing action.



来源:https://stackoverflow.com/questions/37542901/typeerror-failed-to-execute-contains-on-node-parameter-1-is-not-of-type-n

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!