๐น`slotchange` event
JS.info โฉ Updating slots
Google โฉ Working with slots in JS
The slotchange
event fires when a slot's distributed nodes changes. For example, if the user adds/removes children from the light DOM.
const slot = this.shadowRoot.querySelector('#slot');
// โญ๏ธ `slotchange` event listener
slot.addEventListener('slotchange', e => {
console.log('light dom children changed!');
});
example
๐พ replit
Last updated
Was this helpful?