diff --git a/app/renderer/components/navigation/urlBar.js b/app/renderer/components/navigation/urlBar.js index adf3d7c2b16..4eba48ae0c0 100644 --- a/app/renderer/components/navigation/urlBar.js +++ b/app/renderer/components/navigation/urlBar.js @@ -265,6 +265,8 @@ class UrlBar extends React.Component { onChange (e) { if (e.target.value !== this.lastVal + this.lastSuffix) { e.preventDefault() + // clear any current arrow or mouse hover selection + windowActions.setUrlBarSuggestions(undefined, null) this.setValue(e.target.value) } } @@ -301,6 +303,8 @@ class UrlBar extends React.Component { if (this.props.isSelected) { windowActions.setUrlBarSelected(false) } + // clear any current arrow or mouse hover selection + windowActions.setUrlBarSuggestions(undefined, null) this.keyPressed = false windowActions.setNavBarUserInput(this.lastVal) } diff --git a/test/navbar-components/urlBarTest.js b/test/navbar-components/urlBarTest.js index 90af0df1fa6..f1dc8075048 100644 --- a/test/navbar-components/urlBarTest.js +++ b/test/navbar-components/urlBarTest.js @@ -126,7 +126,7 @@ describe('urlBar tests', function () { }) describe('with scrolling match', function () { - it('does not show suggestions on focus', function * () { + it('typing in the urlbar should override mouse hover for suggestions', function * () { yield this.app.client .addSite({ location: 'https://brave.com/test2' }) .addSite({ location: 'https://brave.com/test3' }) @@ -135,9 +135,9 @@ describe('urlBar tests', function () { .resizeWindow(500, 300) .setValue(urlInput, 'b') .waitForVisible(urlBarSuggestions) - .moveToObject(urlBarSuggestions, 0, 50) + // highlight for autocomplete brianbondy.com .moveToObject(urlBarSuggestions, 0, 100) - .moveToObject(urlBarSuggestions, 0, 150) + yield selectsText(this.app.client, 'rianbondy.com') .keys('ra') .execute(function (urlBarSuggestions) { document.querySelector(urlBarSuggestions).scrollTop = 200