Skip to content

Commit

Permalink
fix: trim the searchTerm before searching (#892)
Browse files Browse the repository at this point in the history
* fix: trim the searchTerm before searching

* fix: add search term trimming everywhere else

(cherry picked from commit 44a1ab5)
  • Loading branch information
JustARatherRidiculouslyLongUsername committed Jul 31, 2024
1 parent 44735b7 commit 99e634a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export class ConfigurationSelectFieldComponent implements OnInit {
}

searchOptions(event: any) {
this.searchOptionsDropdown.emit({ searchTerm: event.filter, destinationAttributes: this.destinationAttributes, destinationOptionKey: this.destinationOptionKey });
this.searchOptionsDropdown.emit({ searchTerm: (event.filter as string).trim(), destinationAttributes: this.destinationAttributes, destinationOptionKey: this.destinationOptionKey });
}

ngOnInit(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export class GenericMappingTableComponent implements OnInit {
searchOptions(event: any) {
if (event.filter) {
this.isSearching = true;
this.optionSearchUpdate.next({searchTerm: event.filter});
this.optionSearchUpdate.next({searchTerm: (event.filter as string).trim()});
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class MappingFilterComponent implements OnInit {

searchingFilter(): void {
this.form.controls.searchOption.valueChanges.subscribe((searchValue) => {
this.mappingSearchingEvent.emit(searchValue);
this.mappingSearchingEvent.emit((searchValue as string).trim());
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/components/input/search/search.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class SearchComponent implements OnInit {

private searchQueryWatcher(): void {
this.form.controls.searchOption.valueChanges.subscribe((value) => {
this.handleSimpleSearch.emit(value);
this.handleSimpleSearch.emit((value as string).trim());
});
}

Expand Down

0 comments on commit 99e634a

Please sign in to comment.