Skip to content

Commit 99e634a

Browse files
fix: trim the searchTerm before searching (#892)
* fix: trim the searchTerm before searching * fix: add search term trimming everywhere else (cherry picked from commit 44a1ab5)
1 parent 44735b7 commit 99e634a

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/app/shared/components/configuration/configuration-select-field/configuration-select-field.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export class ConfigurationSelectFieldComponent implements OnInit {
149149
}
150150

151151
searchOptions(event: any) {
152-
this.searchOptionsDropdown.emit({ searchTerm: event.filter, destinationAttributes: this.destinationAttributes, destinationOptionKey: this.destinationOptionKey });
152+
this.searchOptionsDropdown.emit({ searchTerm: (event.filter as string).trim(), destinationAttributes: this.destinationAttributes, destinationOptionKey: this.destinationOptionKey });
153153
}
154154

155155
ngOnInit(): void {

src/app/shared/components/helper/mapping/generic-mapping-table/generic-mapping-table.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export class GenericMappingTableComponent implements OnInit {
138138
searchOptions(event: any) {
139139
if (event.filter) {
140140
this.isSearching = true;
141-
this.optionSearchUpdate.next({searchTerm: event.filter});
141+
this.optionSearchUpdate.next({searchTerm: (event.filter as string).trim()});
142142
}
143143
}
144144

src/app/shared/components/helper/mapping/mapping-filter/mapping-filter.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export class MappingFilterComponent implements OnInit {
7070

7171
searchingFilter(): void {
7272
this.form.controls.searchOption.valueChanges.subscribe((searchValue) => {
73-
this.mappingSearchingEvent.emit(searchValue);
73+
this.mappingSearchingEvent.emit((searchValue as string).trim());
7474
});
7575
}
7676

src/app/shared/components/input/search/search.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export class SearchComponent implements OnInit {
5959

6060
private searchQueryWatcher(): void {
6161
this.form.controls.searchOption.valueChanges.subscribe((value) => {
62-
this.handleSimpleSearch.emit(value);
62+
this.handleSimpleSearch.emit((value as string).trim());
6363
});
6464
}
6565

0 commit comments

Comments
 (0)