webcomponents / webcomponents/polyfills

[scoped-custom-element-registry] When used, elements defined globally remain undefined

Open
#602 2 comments 0 reactions 0 assignees View on GitHub
Focus Area: Standards & Polyfills Type: Bug
Dominant language
HTML
Stars
1.2k
Forks
168
PR merge metrics
No merged PRs in 30d

Description

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

1. Define `my-parent` with a scoped custom element registry
2. In its shadow DOM render a `my-child` element
3. Define `my-child` in global registry

#### Expected behavior

`my-child` should be correctly upgraded

#### Actual behavior

`my-child` remains undefined unless it is added to the scoped element registry

### Version

```
"@webcomponents/scoped-custom-element-registry": "^0.0.9",
"@open-wc/scoped-elements": "^3.0.5",
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.