Re: [WICG/webcomponents] HTML Modules (#645)

@Swivelgames 

You can already create this monstrocity:

````html
<template id="myCustomElementTemplate">
    <button onclick="this.getRootNode().host.constructor.handleClick.call(this, event)">Click me!</button>
</template>
````

And yes, it works and is cloneable. Though `on*` has the browser construct a new function and bind it with a EventListener that cannot be removed from JS. That doesn't scale well for very large DOMs (eg: table grid cells with `click`).


-- 
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/issues/645#issuecomment-1310769124
You are receiving this because you are subscribed to this thread.

Message ID: <WICG/webcomponents/issues/645/1310769124@github.com>

Received on Thursday, 10 November 2022 19:06:26 UTC