mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-28 19:56:42 +00:00
Fix disabled language picker (#25278)
This commit is contained in:
parent
b0d4c699db
commit
b4f1c8755d
@ -102,7 +102,7 @@ export class HaLanguagePicker extends LitElement {
|
|||||||
localeChanged
|
localeChanged
|
||||||
) {
|
) {
|
||||||
this._select.layoutOptions();
|
this._select.layoutOptions();
|
||||||
if (this._select.value !== this.value) {
|
if (!this.disabled && this._select.value !== this.value) {
|
||||||
fireEvent(this, "value-changed", { value: this._select.value });
|
fireEvent(this, "value-changed", { value: this._select.value });
|
||||||
}
|
}
|
||||||
if (!this.value) {
|
if (!this.value) {
|
||||||
@ -141,7 +141,10 @@ export class HaLanguagePicker extends LitElement {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const value =
|
const value =
|
||||||
this.value ?? (this.required ? languageOptions[0]?.value : this.value);
|
this.value ??
|
||||||
|
(this.required && !this.disabled
|
||||||
|
? languageOptions[0]?.value
|
||||||
|
: this.value);
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
<ha-select
|
<ha-select
|
||||||
@ -182,7 +185,7 @@ export class HaLanguagePicker extends LitElement {
|
|||||||
|
|
||||||
private _changed(ev): void {
|
private _changed(ev): void {
|
||||||
const target = ev.target as HaSelect;
|
const target = ev.target as HaSelect;
|
||||||
if (target.value === "" || target.value === this.value) {
|
if (this.disabled || target.value === "" || target.value === this.value) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.value = target.value;
|
this.value = target.value;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user