From a0dae8da3ef5343ec3a19cd8c243904773643ca8 Mon Sep 17 00:00:00 2001 From: oscar marina Date: Fri, 25 Jul 2025 00:48:06 +0200 Subject: [PATCH] [scoped-custom-element-registry] Align patched HTMLElement with native inheritance --- .../src/scoped-custom-element-registry.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/scoped-custom-element-registry/src/scoped-custom-element-registry.ts b/packages/scoped-custom-element-registry/src/scoped-custom-element-registry.ts index d46f9228..c646b552 100644 --- a/packages/scoped-custom-element-registry/src/scoped-custom-element-registry.ts +++ b/packages/scoped-custom-element-registry/src/scoped-custom-element-registry.ts @@ -343,6 +343,8 @@ window.HTMLElement = (function HTMLElement(this: HTMLElement) { return instance; } as unknown) as typeof HTMLElement; window.HTMLElement.prototype = NativeHTMLElement.prototype; +window.HTMLElement.prototype.constructor = window.HTMLElement; +Object.setPrototypeOf(window.HTMLElement, NativeHTMLElement); // Helpers to return the scope for a node where its registry would be located const isValidScope = (node: Node) =>