From 9747f3cf41e431554c96772ecc421bbf202822e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20=C3=87etin?= <92744169+mehmetcetin01140@users.noreply.github.com> Date: Wed, 7 Feb 2024 15:30:04 +0300 Subject: [PATCH 1/2] =?UTF-8?q?Fixed=20#14701=20-=20Dropdown=20|=20removin?= =?UTF-8?q?g=20a=20letter=20from=20filter=20that=20comes=20af=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/components/dropdown/dropdown.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 || []; From eaa06c7f2bd574a24a6a54ada136b2b8ba227722 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20=C3=87etin?= <92744169+mehmetcetin01140@users.noreply.github.com> Date: Wed, 7 Feb 2024 15:31:53 +0300 Subject: [PATCH 2/2] refactor --- src/app/components/dropdown/dropdown.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/components/dropdown/dropdown.ts b/src/app/components/dropdown/dropdown.ts index 6db1d0e96ff..f2a30af02da 100755 --- a/src/app/components/dropdown/dropdown.ts +++ b/src/app/components/dropdown/dropdown.ts @@ -1773,7 +1773,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() });