Skip to content

Commit

Permalink
Merge pull request #8818 from Expensify/tgolen-fix-search
Browse files Browse the repository at this point in the history
Return exact search matches at the top of the search list
  • Loading branch information
Julesssss committed Apr 29, 2022
2 parents d1f3643 + 2bff4d1 commit fe432c3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/libs/OptionsListUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,12 @@ function getOptions(reports, personalDetails, activeReportID, {
if (!option.login) {
return 2;
}
return 1;
if (option.login.toLowerCase() !== searchValue.toLowerCase()) {
return 1;
}

// When option.login is an exact match with the search value, returning 0 puts it at the top of the option list
return 0;
}], ['asc']);
}

Expand Down

0 comments on commit fe432c3

Please sign in to comment.