diff --git a/frontend/src/Search/SearchFooter.js b/frontend/src/Search/SearchFooter.js index 3288109b2..a69ff04c6 100644 --- a/frontend/src/Search/SearchFooter.js +++ b/frontend/src/Search/SearchFooter.js @@ -27,7 +27,7 @@ class SearchFooter extends Component { this.state = { searchingReleases: false, - searchQuery: defaultSearchQuery, + searchQuery: defaultSearchQuery || '', searchIndexerIds: defaultIndexerIds, searchCategories: defaultCategories }; @@ -52,14 +52,12 @@ class SearchFooter extends Component { isFetching, defaultIndexerIds, defaultCategories, - defaultSearchQuery, searchError } = this.props; const { searchIndexerIds, - searchCategories, - searchQuery + searchCategories } = this.state; const newState = {}; @@ -72,10 +70,6 @@ class SearchFooter extends Component { newState.searchCategories = defaultCategories; } - if (searchQuery !== defaultSearchQuery) { - newState.searchQuery = defaultSearchQuery; - } - if (prevProps.isFetching && !isFetching && !searchError) { newState.searchingReleases = false; } @@ -92,6 +86,10 @@ class SearchFooter extends Component { this.props.onSearchPress(this.state.searchQuery, this.state.searchIndexerIds, this.state.searchCategories); } + onSearchInputChange = ({ value }) => { + this.setState({ searchQuery: value }); + } + // // Render @@ -121,7 +119,7 @@ class SearchFooter extends Component { autoFocus={true} value={searchQuery} isDisabled={isFetching} - onChange={onInputChange} + onChange={this.onSearchInputChange} />