Skip to content

Commit

Permalink
Fixed #14865 - Dropdown | TypeError: this.getOptionLabel(...).toLocal…
Browse files Browse the repository at this point in the history
…eLowerCase is not a function
  • Loading branch information
mehmetcetin01140 committed Mar 7, 2024
1 parent 5dae6e5 commit 6ea3116
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app/components/dropdown/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -918,9 +918,9 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV
!_filterBy && !this.filterFields && !this.optionValue
? this.options.filter((option) => {
if (option.label) {
return option.label.toLowerCase().indexOf(this._filterValue().toLowerCase().trim()) !== -1;
return option.label.toString().toLowerCase().indexOf(this._filterValue().toLowerCase().trim()) !== -1;
}
return option.toLowerCase().indexOf(this._filterValue().toLowerCase().trim()) !== -1;
return option.toString().toLowerCase().indexOf(this._filterValue().toLowerCase().trim()) !== -1;
})
: this.filterService.filter(options, this.searchFields(), this._filterValue().trim(), this.filterMatchMode, this.filterLocale);

Expand Down Expand Up @@ -1809,7 +1809,7 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV
}

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));
}

onFilterInputChange(event: Event | any): void {
Expand Down

0 comments on commit 6ea3116

Please sign in to comment.