- From: MichaelPeter <notifications@github.com>
- Date: Tue, 10 Nov 2020 13:52:09 -0800
- To: WICG/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <WICG/webcomponents/issues/908/724988508@github.com>
But that requires the component to implement it right? Lets say I have this test component ``` customElements.define('webcomp-event', class extends HTMLElement { constructor() { super(); // always call super() first in the constructor. this._clickCount = 0; // Attach a shadow root to <fancy-tabs>. const shadowRoot = this.attachShadow({ mode: 'open' }); shadowRoot.innerHTML = ` <label> <input type="checkbox" id="my-checkbox"></input> Change to Raise event </label> `; // Internal event listener shadowRoot.querySelector('#my-checkbox').addEventListener('click', (e) => { this._clickCount++; this.customCheckEvent = new CustomEvent("customcheck", { detail: { clickCount: this._clickCount, isChecked: e.target.checked }, bubbles: true, composed: true, cancelable: false, }); this.dispatchEvent(this.customCheckEvent); console.log(`input.clickEvent ${e.target.checked}`); }); } }); ``` So how I would support this behavior? Add attributeChangedCallback on 'on' + eventName and then parse the (javascript-)value? So this is essentially a feature the web component frameworks like lit-element need to support? Thank you for the help 👍 -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/WICG/webcomponents/issues/908#issuecomment-724988508
Received on Tuesday, 10 November 2020 21:52:22 UTC