Skip to content

Commit

Permalink
Fixed #14454 - Listbox | filter is not working if options is bind to …
Browse files Browse the repository at this point in the history
…a string array
  • Loading branch information
mehmetcetin01140 committed Jul 9, 2024
1 parent e804cd6 commit 4e5975d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/app/components/listbox/listbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,11 @@ export class Listbox implements AfterContentInit, OnInit, ControlValueAccessor,

visibleOptions = computed(() => {
const options = this.group ? this.flatOptions(this._options()) : this._options() || [];
return this._filterValue() ? this.filterService.filter(options, this.searchFields, this._filterValue(), this.filterMatchMode, this.filterLocale) : options;
const filterValue = this._filterValue();

if (this.searchFields[0] === undefined) {
return filterValue ? options.filter((option) => option.toString().toLocaleLowerCase(this.filterLocale).indexOf(filterValue.toLocaleLowerCase(this.filterLocale).trim()) !== -1) : options;
} else return filterValue ? this.filterService.filter(options, this.searchFields, this._filterValue(), this.filterMatchMode, this.filterLocale) : options;
});

constructor(
Expand Down

0 comments on commit 4e5975d

Please sign in to comment.