Skip to content

Commit 955bcb9

Browse files
Merge pull request #748 from PiotrMachowski/bugfix-editor-detection
Fix editor detection
2 parents 9f01e6b + ef1a1ea commit 955bcb9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/xiaomi-vacuum-map-card.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,7 @@ export class XiaomiVacuumMapCard extends LitElement {
827827

828828
private _isInEditor(): boolean {
829829
function isInEditor(e: Element): boolean {
830-
return e.parentElement?.tagName?.toLowerCase() === "hui-card-preview"
830+
return (e.parentElement?.tagName?.toLowerCase() === "hui-card" && "preview" in (e.parentElement?.attributes ?? []))
831831
|| e.parentElement != null && isInEditor(e.parentElement)
832832
|| e.parentNode?.toString() == "[object ShadowRoot]" && isInEditor((e.getRootNode() as ShadowRoot).host);
833833
}

0 commit comments

Comments
 (0)