1
0
mirror of https://github.com/ascribe/onion.git synced 2024-06-26 11:16:28 +02:00

bug fix for going to a piece when in a search

This commit is contained in:
Tim Daubenschütz 2015-10-13 17:30:49 +02:00
parent ea40181805
commit 3321379a8f

View File

@ -76,7 +76,7 @@ const SearchBar = React.createClass({
*
* Like how it's being done in the 'Clear search' dialog.
*/
if(this.props.searchQuery !== nextProps.searchQuery) {
if(this.props.searchQuery !== nextProps.searchQuery || !this.state.searchQuery) {
this.setState({ searchQuery: nextProps.searchQuery });
}
},
@ -117,7 +117,7 @@ const SearchBar = React.createClass({
render() {
let searchIcon = <Glyphicon glyph='search' className="filter-glyph"/>;
const { className } = this.props;
const { loading } = this.state;
const { loading, searchQuery } = this.state;
if(loading) {
searchIcon = <span className="glyph-ascribe-spool-chunked ascribe-color spin"/>;
@ -127,7 +127,7 @@ const SearchBar = React.createClass({
<span className={className}>
<Input
type='text'
value={this.state.searchQuery}
value={searchQuery}
placeholder={getLangText('Search%s', '...')}
onChange={this.handleChange}
addonAfter={searchIcon} />