diff --git a/js/src/ui/Tags/tags.js b/js/src/ui/Tags/tags.js index 23501b24f..b52050649 100644 --- a/js/src/ui/Tags/tags.js +++ b/js/src/ui/Tags/tags.js @@ -38,19 +38,21 @@ export default class Tags extends Component { ? [ styles.tag, styles.tagClickable ] : [ styles.tag ]; - return tags.map((tag, idx) => { - const onClick = handleAddSearchToken - ? () => handleAddSearchToken(tag) - : null; + return tags + .sort() + .map((tag, idx) => { + const onClick = handleAddSearchToken + ? () => handleAddSearchToken(tag) + : null; - return ( -
- { tag } -
- ); - }); + return ( +
+ { tag } +
+ ); + }); } } diff --git a/js/src/views/Accounts/List/list.js b/js/src/views/Accounts/List/list.js index 81d83b60c..bcdf7b072 100644 --- a/js/src/views/Accounts/List/list.js +++ b/js/src/views/Accounts/List/list.js @@ -130,15 +130,14 @@ export default class List extends Component { .concat(tags, name) .map(v => v.toLowerCase()); - return values - .filter((value) => { - return searchValues - .map(searchValue => value.indexOf(searchValue) >= 0) - // `current && truth, true` => use tokens as AND - // `current || truth, false` => use tokens as OR - .reduce((current, truth) => current || truth, false); + return searchValues + .map(searchValue => { + return values + .some(value => value.indexOf(searchValue) >= 0); }) - .length > 0; + // `current && truth, true` => use tokens as AND + // `current || truth, false` => use tokens as OR + .reduce((current, truth) => current && truth, true); }); } }