Fix keyboard search

This commit is contained in:
Andrey Shimagin 2022-04-01 14:39:20 +03:00
parent 4341ea35c9
commit fe43be62af

View file

@ -234,6 +234,12 @@ class SearchView extends Component {
}); });
} }
onSearchKeyBoard(event) {
if(event.keyCode === 13) {
this.props.onSearchQuery(this.searchParams());
}
}
render() { render() {
const usereplace = searchOptions.usereplace; const usereplace = searchOptions.usereplace;
const isReplaceAll = searchOptions.isReplaceAll; const isReplaceAll = searchOptions.isReplaceAll;
@ -258,7 +264,8 @@ class SearchView extends Component {
</div> </div>
<div className="searchbar-inner__center"> <div className="searchbar-inner__center">
<div className="searchbar-input-wrap"> <div className="searchbar-input-wrap">
<input className="searchbar-input" value={searchQuery} placeholder={_t.textSearch} type="text" maxLength="255" <input className="searchbar-input" value={searchQuery} placeholder={_t.textSearch} type="search" maxLength="255"
onKeyDown={e => this.onSearchKeyBoard(e)}
onChange={e => {this.changeSearchQuery(e.target.value)}} /> onChange={e => {this.changeSearchQuery(e.target.value)}} />
{isIos ? <i className="searchbar-icon" /> : null} {isIos ? <i className="searchbar-icon" /> : null}
<span className="input-clear-button" onClick={() => this.changeSearchQuery('')} /> <span className="input-clear-button" onClick={() => this.changeSearchQuery('')} />