Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/primefaces/primeng
Browse files Browse the repository at this point in the history
  • Loading branch information
cetincakiroglu committed Feb 7, 2024
2 parents 5129958 + 9c9db74 commit ec19737
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/app/components/dropdown/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -912,11 +912,11 @@ 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()) !== -1;
return option.label.toLowerCase().indexOf(this._filterValue().toLowerCase().trim()) !== -1;
}
return option.toLowerCase().indexOf(this._filterValue().toLowerCase()) !== -1;
return option.toLowerCase().indexOf(this._filterValue().toLowerCase().trim()) !== -1;
})
: this.filterService.filter(options, this.searchFields(), this._filterValue(), this.filterMatchMode, this.filterLocale);
: this.filterService.filter(options, this.searchFields(), this._filterValue().trim(), this.filterMatchMode, this.filterLocale);

if (this.group) {
const optionGroups = this.options || [];
Expand Down Expand Up @@ -1774,7 +1774,7 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV
}

onFilterInputChange(event: Event | any): void {
let value: string = (event.target as HTMLInputElement).value?.trim();
let value: string = (event.target as HTMLInputElement).value
this._filterValue.set(value);
this.focusedOptionIndex.set(-1);
this.onFilter.emit({ originalEvent: event, filter: this._filterValue() });
Expand Down

0 comments on commit ec19737

Please sign in to comment.