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

Commit ff41f60

Browse files
committed
Don't do suggestion actions on non-char key presses
Auditors: @bsclifton Fix #5878 Test comming in a follow up commit now, just pushing without so you can get a build going
1 parent afd891f commit ff41f60

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

app/renderer/components/navigation/urlBar.js

+3
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,9 @@ class UrlBar extends React.Component {
324324
case KeyCodes.DOWN:
325325
case KeyCodes.TAB:
326326
case KeyCodes.ESC:
327+
case KeyCodes.LEFT:
328+
case KeyCodes.SHIFT:
329+
case KeyCodes.RIGHT:
327330
return
328331
}
329332
if (this.props.isSelected) {

test/navbar-components/urlBarSuggestionsTest.js

+17
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,23 @@ describe('urlBarSuggestions', function () {
6666
.waitForElementCount(urlBarSuggestions, 0)
6767
})
6868

69+
it('deactivated suggestions do not pop back up when left or shift is pressed', function * () {
70+
yield this.app.client
71+
.setInputText(urlInput, 'Page 1')
72+
.waitForExist(urlBarSuggestions + ' li.suggestionItem[data-index="0"]')
73+
.keys(Brave.keys.BACKSPACE)
74+
.waitForElementCount(urlBarSuggestions, 0)
75+
.keys(Brave.keys.LEFT)
76+
.pause(50)
77+
.keys(Brave.keys.SHIFT + Brave.keys.LEFT)
78+
.pause(50)
79+
.keys(Brave.keys.LEFT)
80+
.pause(50)
81+
.keys(Brave.keys.SHIFT)
82+
.pause(50)
83+
.waitForElementCount(urlBarSuggestions, 0)
84+
})
85+
6986
it('deactivates suggestions on delete', function * () {
7087
yield this.app.client
7188
.setInputText(urlInput, 'Page 1')

0 commit comments

Comments
 (0)