Skip to content

Commit

Permalink
Merge pull request #14440 from Expensify/ionatan_fixcurrencysearch
Browse files Browse the repository at this point in the history
Fix currency search
  • Loading branch information
iwiznia authored Jan 24, 2023
2 parents 25b47da + 73d23d8 commit c2ff5f8
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 @@ -2,6 +2,7 @@ import React, {Component} from 'react';
import PropTypes from 'prop-types';
import {withOnyx} from 'react-native-onyx';
import _ from 'underscore';
import Str from 'expensify-common/lib/str';
import ONYXKEYS from '../../ONYXKEYS';
import OptionsSelector from '../../components/OptionsSelector';
import Navigation from '../../libs/Navigation/Navigation';
Expand Down Expand Up @@ -88,7 +89,7 @@ class IOUCurrencySelection extends Component {
*/
changeSearchValue(searchValue) {
const currencyOptions = this.getCurrencyOptions(this.props.currencyList);
const searchRegex = new RegExp(searchValue, 'i');
const searchRegex = new RegExp(Str.escapeForRegExp(searchValue), 'i');
const filteredCurrencies = _.filter(currencyOptions, currencyOption => searchRegex.test(currencyOption.text));

this.setState({
Expand Down

0 comments on commit c2ff5f8

Please sign in to comment.