Skip to content

Commit

Permalink
Allow currency search by currency name
Browse files Browse the repository at this point in the history
  • Loading branch information
huzaifa-99 committed Sep 21, 2023
1 parent f39e93f commit b123a76
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pages/iou/IOUCurrencySelection.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ function IOUCurrencySelection(props) {
const currencyOptions = _.map(currencyList, (currencyInfo, currencyCode) => {
const isSelectedCurrency = currencyCode === selectedCurrencyCode;
return {
currencyName: currencyInfo.name,
text: `${currencyCode} - ${CurrencyUtils.getLocalizedCurrencySymbol(currencyCode)}`,
currencyCode,
keyForList: currencyCode,
Expand All @@ -105,7 +106,7 @@ function IOUCurrencySelection(props) {
});

const searchRegex = new RegExp(Str.escapeForRegExp(searchValue.trim()), 'i');
const filteredCurrencies = _.filter(currencyOptions, (currencyOption) => searchRegex.test(currencyOption.text));
const filteredCurrencies = _.filter(currencyOptions, (currencyOption) => searchRegex.test(currencyOption.text) || searchRegex.test(currencyOption.currencyName));
const isEmpty = searchValue.trim() && !filteredCurrencies.length;

return {
Expand Down

0 comments on commit b123a76

Please sign in to comment.