Remove shadowroot from ha-markdown-element (#9187)

This commit is contained in:
Paulus Schoutsen 2021-05-15 03:23:33 -07:00 committed by GitHub
parent 9f32d72a41
commit f4ffbe67e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,11 +10,8 @@ class HaMarkdownElement extends ReactiveElement {
@property({ type: Boolean }) public breaks = false; @property({ type: Boolean }) public breaks = false;
public connectedCallback() { protected createRenderRoot() {
super.connectedCallback(); return this;
if (!this.shadowRoot) {
this.attachShadow({ mode: "open" });
}
} }
protected update(changedProps) { protected update(changedProps) {
@ -25,7 +22,7 @@ class HaMarkdownElement extends ReactiveElement {
} }
private async _render() { private async _render() {
this.shadowRoot!.innerHTML = await renderMarkdown( this.innerHTML = await renderMarkdown(
this.content, this.content,
{ {
breaks: this.breaks, breaks: this.breaks,
@ -39,8 +36,10 @@ class HaMarkdownElement extends ReactiveElement {
this._resize(); this._resize();
const walker = document.createTreeWalker( const walker = document.createTreeWalker(
this.shadowRoot!, this,
1 /* SHOW_ELEMENT */ 1 /* SHOW_ELEMENT */,
null,
false
); );
while (walker.nextNode()) { while (walker.nextNode()) {