From 3321379a8f6c40f20dff9b59f9b85640d707eb11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Tue, 13 Oct 2015 17:30:49 +0200 Subject: [PATCH] bug fix for going to a piece when in a search --- js/components/search_bar.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/components/search_bar.js b/js/components/search_bar.js index d5b5cefe..e8382489 100644 --- a/js/components/search_bar.js +++ b/js/components/search_bar.js @@ -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 = ; const { className } = this.props; - const { loading } = this.state; + const { loading, searchQuery } = this.state; if(loading) { searchIcon = ; @@ -127,7 +127,7 @@ const SearchBar = React.createClass({