mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 15:26:36 +00:00
Fix clearing of picture (e.g. area and person config)
This commit is contained in:
parent
7ccde2cb41
commit
ff7a2c8cb7
@ -39,6 +39,7 @@ export class HaPictureUpload extends LitElement {
|
|||||||
.uploading=${this._uploading}
|
.uploading=${this._uploading}
|
||||||
.value=${this.value ? html`<img .src=${this.value} />` : ""}
|
.value=${this.value ? html`<img .src=${this.value} />` : ""}
|
||||||
@file-picked=${this._handleFilePicked}
|
@file-picked=${this._handleFilePicked}
|
||||||
|
@change=${this._handleFileCleared}
|
||||||
accept="image/png, image/jpeg, image/gif"
|
accept="image/png, image/jpeg, image/gif"
|
||||||
></ha-file-upload>
|
></ha-file-upload>
|
||||||
`;
|
`;
|
||||||
@ -53,6 +54,10 @@ export class HaPictureUpload extends LitElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async _handleFileCleared() {
|
||||||
|
this.value = null;
|
||||||
|
}
|
||||||
|
|
||||||
private async _cropFile(file: File) {
|
private async _cropFile(file: File) {
|
||||||
if (!["image/png", "image/jpeg", "image/gif"].includes(file.type)) {
|
if (!["image/png", "image/jpeg", "image/gif"].includes(file.type)) {
|
||||||
showAlertDialog(this, {
|
showAlertDialog(this, {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user