Skip to content

Commit

Permalink
Merge pull request #14961 from primefaces/issue-14960
Browse files Browse the repository at this point in the history
Fixed #14960 - Multiselect | TypeError: option.toLocaleLowerCase is n…
  • Loading branch information
cetincakiroglu authored Mar 7, 2024
2 parents 5a6e994 + 7e60300 commit 9e3afa3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/components/multiselect/multiselect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ export class MultiSelect implements OnInit, AfterViewInit, AfterContentInit, Aft
if (isArrayOfObjects) {
filteredOptions = this.filterService.filter(options, this.searchFields(), this._filterValue(), this.filterMatchMode, this.filterLocale);
} else {
filteredOptions = options.filter((option) => option.toLocaleLowerCase().includes(this._filterValue().toLocaleLowerCase()));
filteredOptions = options.filter((option) => option.toString().toLocaleLowerCase().includes(this._filterValue().toLocaleLowerCase()));
}

if (this.group) {
Expand Down Expand Up @@ -1392,7 +1392,7 @@ export class MultiSelect implements OnInit, AfterViewInit, AfterContentInit, Aft
}

isOptionMatched(option) {
return this.isValidOption(option) && this.getOptionLabel(option).toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale));
return this.isValidOption(option) && this.getOptionLabel(option).toString().toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale));
}

isEmpty() {
Expand Down

0 comments on commit 9e3afa3

Please sign in to comment.