diff --git a/src/app/components/dropdown/dropdown.ts b/src/app/components/dropdown/dropdown.ts index 029b537cb6e..6db1d0e96ff 100755 --- a/src/app/components/dropdown/dropdown.ts +++ b/src/app/components/dropdown/dropdown.ts @@ -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 || [];