Fix select issues (#13839)

This commit is contained in:
Bram Kragten 2022-09-22 15:19:59 +02:00 committed by GitHub
parent 8e245c8a83
commit 7336c1280f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,7 +41,7 @@ export class HaSelectSelector extends LitElement {
);
if (!this.selector.select.custom_value && this._mode === "list") {
if (!this.selector.select.multiple || this.required) {
if (!this.selector.select.multiple) {
return html`
<div>
${this.label}
@ -64,7 +64,8 @@ export class HaSelectSelector extends LitElement {
return html`
<div>
${this.label}${options.map(
${this.label}
${options.map(
(item: SelectOption) => html`
<ha-formfield .label=${item.label}>
<ha-checkbox
@ -114,7 +115,7 @@ export class HaSelectSelector extends LitElement {
.required=${this.required && !value.length}
.value=${this._filter}
.items=${options.filter(
(item) => !item.disabled && !this.value?.includes(item.value)
(option) => !option.disabled && !value?.includes(option.value)
)}
@filter-changed=${this._filterChanged}
@value-changed=${this._comboBoxValueChanged}
@ -290,6 +291,9 @@ export class HaSelectSelector extends LitElement {
ha-formfield {
display: block;
}
mwc-list-item[disabled] {
--mdc-theme-text-primary-on-background: var(--disabled-text-color);
}
`;
}