Search for new movie rather than select first suggestion

This commit is contained in:
Rob Jack Stewart 2024-02-18 13:20:23 +00:00
parent 63f16924b1
commit 37ab270c89
1 changed files with 5 additions and 6 deletions

View File

@ -161,13 +161,12 @@ class MovieSearchInput extends Component {
return;
}
// If an suggestion is not selected go to the first movie,
// otherwise go to the selected movie.
if (highlightedSuggestionIndex == null) {
this.goToMovie(suggestions[0]);
} else {
// If a suggestion is highlighted, go to that movie
// otherwise search for a new movie
if (highlightedSuggestionIndex) {
this.goToMovie(suggestions[highlightedSuggestionIndex]);
} else {
this.props.onGoToAddNewMovie(value);
}
this._autosuggest.input.blur();