Skip to content

Commit

Permalink
🐛 autosuggest, fix index handling of selected recent search
Browse files Browse the repository at this point in the history
  • Loading branch information
faival committed Jun 15, 2018
1 parent ddf6f74 commit 2b97e54
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/autoSuggest/index.js
Expand Up @@ -98,8 +98,8 @@ class AutoSuggest extends React.Component {
let currentIdx = this.state.selectedIdx;
let placeholder = '';
if (this.state.resultsLength === 0) {
currentIdx = (currentIdx === this.recentSearches.length) ?
this.recentSearches.length : currentIdx += 1;
currentIdx = (currentIdx === this.recentSearches.length - 1) ?
this.recentSearches.length - 1 : currentIdx += 1;
placeholder = this.recentSearches[currentIdx].valueLeft;
} else {
currentIdx = (currentIdx === this.state.resultsLength) ?
Expand Down

0 comments on commit 2b97e54

Please sign in to comment.