Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Only consider suggestion index when suggestions exist
Browse files Browse the repository at this point in the history
Follow up tweak for #5389

Audtiors: @diracdeltas
  • Loading branch information
bbondy committed Nov 11, 2016
1 parent 7d92312 commit 83eccb5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions js/components/urlBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,10 @@ class UrlBar extends ImmutableComponent {
} else if (this.isActive) {
const selectedIndex = this.activeFrame.getIn(['navbar', 'urlbar', 'suggestions', 'selectedIndex'])
if (typeof selectedIndex === 'number') {
const suggestionLocation = this.activeFrame.getIn(['navbar', 'urlbar', 'suggestions', 'suggestionList', selectedIndex - 1]).location
this.urlInput.value = suggestionLocation
const suggestion = this.activeFrame.getIn(['navbar', 'urlbar', 'suggestions', 'suggestionList', selectedIndex - 1])
if (suggestion) {
this.urlInput.value = suggestion.location
}
}
}
}
Expand Down

0 comments on commit 83eccb5

Please sign in to comment.