-
Notifications
You must be signed in to change notification settings - Fork 492
V1: instanceof operator isn't working for non-patched nodes. #623
Comments
I also found that |
The first issue is more or less unsolvable. Any element that has HTMLElement as its direct prototype can't be patched to make The second issue is fixable and important. We need to copy statics down. |
In case it's useful to others, my team came up with a workaround. It's far from perfect, but it worked well enough for our needs: const div = document.createElement('div');
console.log((/^HTML\w*Element/).test(div.constructor.name)); Further, all of our custom element use a specific prefix, so we could extend the regex to: /^(HTML|Foo)\w*Element/ |
For your custom elements, Another option, which should be fine in basically all cases, is |
thanks for the reply @justinfagnani |
This sounds like a CustomElements polyfill issue so I'm moving it there, sorrynotsorry. |
This issue was moved to webcomponents/custom-elements#48 |
Using the v1, the following assertion fails:
/cc @justinfagnani
The text was updated successfully, but these errors were encountered: