Skip to content

Commit

Permalink
Add trim for searchRegex
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhenjaHorbach committed Nov 1, 2023
1 parent 4acd3b4 commit fc2d0ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pages/iou/IOUCurrencySelection.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function IOUCurrencySelection(props) {
};
});

const searchRegex = new RegExp(Str.escapeForRegExp(searchValue.replace(/\s/g, ' ')), 'i');
const searchRegex = new RegExp(Str.escapeForRegExp(searchValue.trim().replace(/\s/g, ' ')), 'i');
const filteredCurrencies = _.filter(
currencyOptions,
(currencyOption) => searchRegex.test(currencyOption.text.replace(/\s/g, ' ')) || searchRegex.test(currencyOption.currencyName.replace(/\s/g, ' ')),
Expand Down

0 comments on commit fc2d0ea

Please sign in to comment.