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

Commit c4cdd46

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 d1607d8 commit c4cdd46

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-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

+19
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,25 @@ 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+
const pagePartialUrl = Brave.server.url('page')
71+
yield this.app.client
72+
.setInputText(urlInput, 'Page 1')
73+
.waitForExist(urlBarSuggestions + ' li.suggestionItem[data-index="0"]')
74+
.keys(Brave.keys.BACKSPACE)
75+
.waitForElementCount(urlBarSuggestions, 0)
76+
.keys(Brave.keys.LEFT)
77+
.pause(50)
78+
.keys(Brave.keys.SHIFT + Brave.keys.LEFT)
79+
.pause(50)
80+
.keys(Brave.keys.LEFT)
81+
.pause(50)
82+
.keys(Brave.keys.SHIFT)
83+
.pause(50)
84+
.waitForElementCount(urlBarSuggestions, 0)
85+
})
86+
87+
6988
it('deactivates suggestions on delete', function * () {
7089
yield this.app.client
7190
.setInputText(urlInput, 'Page 1')

0 commit comments

Comments
 (0)