Skip to content

Commit 256c343

Browse files
Update src/panels/lovelace/editor/config-elements/hui-map-card-editor.ts
Co-authored-by: Petar Petrov <MindFreeze@users.noreply.github.com>
1 parent de5b4ae commit 256c343

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/panels/lovelace/editor/config-elements/hui-map-card-editor.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -422,15 +422,12 @@ export class HuiMapCardEditor extends LitElement implements LovelaceCardEditor {
422422
}
423423

424424
private _valueChanged(ev: CustomEvent): void {
425-
if (
426-
ev.detail.value.show_all &&
427-
ev.detail.value.entities &&
428-
ev.detail.value.entities.length === 0
429-
) {
430-
// remove "entities: []" line since "show_all: true" is present
431-
delete ev.detail.value.entities;
425+
ev.stopPropagation();
426+
let config = { ...ev.detail.value };
427+
if (config.show_all && config.entities?.length === 0) {
428+
delete config.entities;
432429
}
433-
const config = this._orderProperties(ev.detail.value);
430+
config = this._orderProperties(config);
434431
fireEvent(this, "config-changed", { config });
435432
}
436433

0 commit comments

Comments
 (0)