Skip to content

Polyfilling internals for webcomponents #68

@bakura10

Description

@bakura10

Hello,

I had an issue with the invoker spec, where commands could not be used for custom elements. A solution is being experimented (for now on Chrome 143 - cf issue -). This is not yet final, but I'm adding it here as a reminder.

With this, it is possible to make any custom elements an invokee:

class CustomButton extends HTMLElement {
  constructor() {
    const internals = this.attachInternals();
    internals.type = "button";
  }
}

window.customElements.define('custom-button', CustomButton);
<custom-button commandfor="foo" command="--bar">
  <button type="button">Real button</button>
</custom-button>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions