1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-27 12:36:14 +01:00

trim search term

This commit is contained in:
Kyle Spearrin 2018-07-06 14:11:47 -04:00
parent b9a15d7ced
commit e25ad93082
2 changed files with 2 additions and 2 deletions

View File

@ -26,7 +26,7 @@ export class SearchCiphersPipe implements PipeTransform {
return ciphers; return ciphers;
} }
searchText = searchText.toLowerCase(); searchText = searchText.trim().toLowerCase();
return ciphers.filter((c) => { return ciphers.filter((c) => {
if (c.name != null && c.name.toLowerCase().indexOf(searchText) > -1) { if (c.name != null && c.name.toLowerCase().indexOf(searchText) > -1) {
return true; return true;

View File

@ -16,7 +16,7 @@ export class SearchPipe implements PipeTransform {
return items; return items;
} }
searchText = searchText.toLowerCase(); searchText = searchText.trim().toLowerCase();
return items.filter((i) => { return items.filter((i) => {
if (prop1 != null && i[prop1] != null && i[prop1].toString().toLowerCase().indexOf(searchText) > -1) { if (prop1 != null && i[prop1] != null && i[prop1].toString().toLowerCase().indexOf(searchText) > -1) {
return true; return true;