You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In short, I wanted to use globally defined elements in an element which also uses a scoped registry. In my real scenario, the global elements are Shoelace.
Unfortunately, if I use a global element inside a shadow root with scoped registry, it is not created as expected.
tpluscode
changed the title
[scoped-custom-element-registry] When using scoped custom elements registry, elements defined globally remain undefined
[scoped-custom-element-registry] When used, elements defined globally remain undefined
Dec 16, 2024
This is by design as per the current proposal. You'll need to re-define the elements in the registry in which you want to use them. To implement this automatically, you could potentially override window.customElements.define to capture the list of defined elements and ensure those are re-defined on any local registry.
Description
In short, I wanted to use globally defined elements in an element which also uses a scoped registry. In my real scenario, the global elements are Shoelace.
Unfortunately, if I use a global element inside a shadow root with scoped registry, it is not created as expected.
Example
https://lit.dev/playground/#gist=aeaab7d7ae68b4341eee63c47d663337
Steps to reproduce
my-parent
with a scoped custom element registrymy-child
elementmy-child
in global registryExpected behavior
my-child
should be correctly upgradedActual behavior
my-child
remains undefined unless it is added to the scoped element registryVersion
The text was updated successfully, but these errors were encountered: