Skip to content

Commit

Permalink
Fixed #14370
Browse files Browse the repository at this point in the history
  • Loading branch information
cetincakiroglu committed Jan 10, 2024
1 parent fc21b93 commit 94a19bf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/app/components/dropdown/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -896,8 +896,10 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV
const options = this.group ? this.flatOptions(this.options) : this.options || [];

if (this._filterValue()) {
const _filterBy = this.filterBy || this.optionLabel;

const filteredOptions =
!this.filterBy && !this.filterFields && !this.optionValue
!_filterBy && !this.filterFields && !this.optionValue
? this.options.filter((option) => option.toLowerCase().indexOf(this._filterValue().toLowerCase()) !== -1)
: this.filterService.filter(options, this.searchFields(), this._filterValue(), this.filterMatchMode, this.filterLocale);
if (this.group) {
Expand Down Expand Up @@ -1663,7 +1665,7 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV
}

searchFields() {
return this.filterBy.split(',') || this.filterFields || [this.optionLabel];
return this.filterBy?.split(',') || this.filterFields || [this.optionLabel];
}

searchOptions(event, char) {
Expand Down Expand Up @@ -1749,4 +1751,3 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV
declarations: [Dropdown, DropdownItem]
})
export class DropdownModule {}

0 comments on commit 94a19bf

Please sign in to comment.