diff --git a/apps/common/mobile/lib/view/Search.jsx b/apps/common/mobile/lib/view/Search.jsx index ae026d894..72f69836c 100644 --- a/apps/common/mobile/lib/view/Search.jsx +++ b/apps/common/mobile/lib/view/Search.jsx @@ -9,7 +9,8 @@ import { observable, runInAction } from "mobx"; import { observer } from "mobx-react"; const searchOptions = observable({ - usereplace: false + usereplace: false, + isReplaceAll: false }); const popoverStyle = { @@ -31,15 +32,20 @@ class SearchSettingsView extends Component { searchBy: 1, lookIn: 1, isMatchCase: false, - isMatchCell: false + isMatchCell: false, + isReplaceAll: false }; } onFindReplaceClick(action) { - runInAction(() => searchOptions.usereplace = action == 'replace'); + runInAction(() => { + searchOptions.usereplace = action == 'replace'; + searchOptions.isReplaceAll = action == 'replace-all'; + }); this.setState({ - useReplace: searchOptions.usereplace + useReplace: searchOptions.usereplace, + isReplaceAll: searchOptions.isReplaceAll }); if (this.onReplaceChecked) {} @@ -251,14 +257,15 @@ class SearchView extends Component { render() { const usereplace = searchOptions.usereplace; + const isReplaceAll = searchOptions.isReplaceAll; const hidden = {display: "none"}; const searchQuery = this.state.searchQuery; - const replaceQuery = this.state.replaceQuery; + // const replaceQuery = this.state.replaceQuery; const isIos = Device.ios; const { _t } = this.props; if(this.searchbar && this.searchbar.enabled) { - usereplace ? this.searchbar.el.classList.add('replace') : this.searchbar.el.classList.remove('replace'); + usereplace || isReplaceAll ? this.searchbar.el.classList.add('replace') : this.searchbar.el.classList.remove('replace'); } return ( @@ -272,22 +279,30 @@ class SearchView extends Component {