Skip to content

Commit 113edda

Browse files
authored
Make sure window is in sync with CustomElements registration
1 parent 6e4b571 commit 113edda

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/register.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ export function register(classObject: CustomElement): void {
1414
.toLowerCase()
1515

1616
try {
17+
window.customElements.define(name, classObject)
1718
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
1819
// @ts-ignore
19-
window[classObject.name] = classObject
20-
window.customElements.define(name, classObject)
20+
window[classObject.name] = customElements.get(name)
2121
} catch {
2222
// silently ignore
2323
}

0 commit comments

Comments
 (0)