Skip to content

Commit

Permalink
search: fix query with trailing space
Browse files Browse the repository at this point in the history
* Adds an input property to set if barcode must be trimmed.
* Closes rero/rero-ils-ui#213.

Co-Authored-by: Alicia Zangger <alicia.zangger@rero.ch>
  • Loading branch information
Alicia Zangger committed Apr 1, 2020
1 parent 825cbf5 commit 6058db6
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,14 @@ export class SearchInputComponent {
}
}

/** Trim barcode if true */
@Input() trimBarcode = true;

doSearch(searchText: string) {
this.search.emit(searchText);
if (this.trimBarcode) {
this.search.emit(searchText.trim());
} else {
this.search.emit(searchText);
}
}
}

0 comments on commit 6058db6

Please sign in to comment.