Fix guiMode toggle bugs in element-editor (#17282)

This commit is contained in:
karwosts 2023-07-20 07:14:32 -07:00 committed by GitHub
parent 38ea25cf5a
commit 11fa9d1ed8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -131,6 +131,7 @@ export abstract class HuiElementEditor<T, C = any> extends LitElement {
}
}
this.updateComplete.then(() => {
fireEvent(this, "config-changed", {
config: this.value! as any,
error: this._errors?.join(", "),
@ -140,6 +141,7 @@ export abstract class HuiElementEditor<T, C = any> extends LitElement {
this._guiSupported === false
),
});
});
}
public get hasWarning(): boolean {
@ -156,6 +158,7 @@ export abstract class HuiElementEditor<T, C = any> extends LitElement {
public set GUImode(guiMode: boolean) {
this._guiMode = guiMode;
this.updateComplete.then(() => {
fireEvent(this as HTMLElement, "GUImode-changed", {
guiMode,
guiModeAvailable: !(
@ -164,6 +167,7 @@ export abstract class HuiElementEditor<T, C = any> extends LitElement {
this._guiSupported === false
),
});
});
}
public toggleMode() {