Fix @changed where using ev.detail (#12043)

This commit is contained in:
Zack Barett 2022-03-14 11:11:46 -05:00 committed by GitHub
parent 1fa04baa16
commit dcf50e055b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 5 deletions

View File

@ -22,7 +22,6 @@ import {
showAlertDialog, showAlertDialog,
showPromptDialog, showPromptDialog,
} from "../../../dialogs/generic/show-dialog-box"; } from "../../../dialogs/generic/show-dialog-box";
import { PolymerChangedEvent } from "../../../polymer-types";
import { haStyleDialog } from "../../../resources/styles"; import { haStyleDialog } from "../../../resources/styles";
import { HomeAssistant } from "../../../types"; import { HomeAssistant } from "../../../types";
import { UserDetailDialogParams } from "./show-dialog-user-detail"; import { UserDetailDialogParams } from "./show-dialog-user-detail";
@ -212,9 +211,9 @@ class DialogUserDetail extends LitElement {
`; `;
} }
private _nameChanged(ev: PolymerChangedEvent<string>) { private _nameChanged(ev) {
this._error = undefined; this._error = undefined;
this._name = ev.detail.value; this._name = ev.target.value;
} }
private _adminChanged(ev): void { private _adminChanged(ev): void {

View File

@ -113,9 +113,9 @@ export class HuiPictureCardEditor
return; return;
} }
const target = ev.target! as EditorTarget; const target = ev.target! as EditorTarget;
const value = ev.detail.value; const value = ev.detail?.value ?? target.value;
if (this[`_${target.configValue}`] === target.value) { if (this[`_${target.configValue}`] === value) {
return; return;
} }
if (target.configValue) { if (target.configValue) {