mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-20 07:46:37 +00:00
Remove shadowroot from ha-markdown-element (#9187)
This commit is contained in:
parent
9f32d72a41
commit
f4ffbe67e2
@ -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()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user