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>
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: