mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Don't push a duplicate entry to select selector when filtering (#22578)
This commit is contained in:
parent
830d8d2410
commit
9a9b2e3900
@ -383,8 +383,13 @@ export class HaSelectSelector extends LitElement {
|
||||
return label.toLowerCase().includes(this._filter?.toLowerCase());
|
||||
});
|
||||
|
||||
if (this._filter && this.selector.select?.custom_value) {
|
||||
filteredItems?.unshift({ label: this._filter, value: this._filter });
|
||||
if (
|
||||
this._filter &&
|
||||
this.selector.select?.custom_value &&
|
||||
filteredItems &&
|
||||
!filteredItems.some((item) => (item.label || item.value) === this._filter)
|
||||
) {
|
||||
filteredItems.unshift({ label: this._filter, value: this._filter });
|
||||
}
|
||||
|
||||
this.comboBox.filteredItems = filteredItems;
|
||||
|
Loading…
x
Reference in New Issue
Block a user