web-components-examples
web-components-examples copied to clipboard
this.shadowRoot is not defined
https://github.com/mdn/web-components-examples/blob/712ce27cd5b3c894ebc9b9958ec0973e3e86157b/slotchange/main.js#L40
this.shadowRoot
Remove this. as this.shadowRoot is null and shadowRoot is already defined
Can I please work on this.
Thanks for reporting. @pepelsbey worked on this one recently, and I believe it worked then. Could you share some info about the browser version you're trying this on?
@SakshiShreya I checked the demo (source, live) and it works the same way and with no errors in both cases:
this.shadowRoot.querySelectorAll('slot')shadowRoot.querySelectorAll('slot')
Could you show the steps to reproduce the error? Otherwise, it would be a stylistic preference and not that important to the example. I’d rather replace <li>s with <button>s to make the demo more accessible :) But that’s another story.