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

Make up/down arrow keys wrap to other end in urlbar suggestions #8546

Merged
merged 1 commit into from
Apr 29, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/renderer/reducers/urlBarSuggestionsReducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,8 @@ const urlBarSuggestionsReducer = (state, action) => {
state = state.setIn(selectedIndexPath, 0)
} else if (selectedIndex > 0) {
state = state.setIn(selectedIndexPath, selectedIndex - 1)
} else {
state = state.setIn(selectedIndexPath, suggestionList.size - 1)
}
state = updateUrlSuffix(state, state.getIn(activeFrameStatePath(state).concat(['navbar', 'urlbar', 'suggestions', 'suggestionList']), suggestionList))
break
Expand All @@ -341,6 +343,8 @@ const urlBarSuggestionsReducer = (state, action) => {
state = state.setIn(selectedIndexPath, 0)
} else if (selectedIndex < suggestionList.size - 1) {
state = state.setIn(selectedIndexPath, selectedIndex + 1)
} else if (selectedIndex === suggestionList.size - 1) {
state = state.setIn(selectedIndexPath, 0)
}
state = updateUrlSuffix(state, state.getIn(activeFrameStatePath(state).concat(['navbar', 'urlbar', 'suggestions', 'suggestionList']), suggestionList))
break
Expand Down