Remove redundant .shadow property as that is defined at the Custom Element level. (#1395)

This commit is contained in:
Andrea Giammarchi
2023-04-21 10:05:50 +02:00
committed by GitHub
parent 8590c7e5b8
commit 0021ccb49f
2 changed files with 3 additions and 13 deletions

View File

@@ -242,7 +242,6 @@ type PyElementClass = (htmlElement: HTMLElement) => PyElementInstance;
export function define_custom_element(tag: string, pyElementClass: PyElementClass): any {
logger.info(`creating plugin: ${tag}`);
class ProxyCustomElement extends HTMLElement {
shadow: ShadowRoot;
wrapper: HTMLElement;
pyElementInstance: PyElementInstance;
originalInnerHTML: string;
@@ -251,9 +250,8 @@ export function define_custom_element(tag: string, pyElementClass: PyElementClas
logger.debug(`creating ${tag} plugin instance`);
super();
this.shadow = this.attachShadow({ mode: 'open' });
this.wrapper = document.createElement('slot');
this.shadow.appendChild(this.wrapper);
this.attachShadow({ mode: 'open' }).appendChild(this.wrapper);
this.originalInnerHTML = this.innerHTML;
this.pyElementInstance = pyElementClass(this);
}