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

Commit

Permalink
update urlbar value on selection change
Browse files Browse the repository at this point in the history
fix #8865
  • Loading branch information
bridiver committed May 15, 2017
1 parent bf55709 commit 9ac2ff6
Show file tree
Hide file tree
Showing 3 changed files with 290 additions and 122 deletions.
7 changes: 7 additions & 0 deletions app/renderer/components/navigation/urlBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,13 @@ class UrlBar extends React.Component {
this.lastSuffix = ''
}

// if there is no selection then we are not in autocomplete
// so make sure that this.lastValue is set to urlInput.value
if (this.urlInput.selectionStart === this.urlInput.selectionEnd) {
this.lastVal = this.urlInput.value
this.lastSuffix = ''
}

const selectionStart = this.urlInput.selectionStart
const newValue = [
this.lastVal.slice(0, selectionStart),
Expand Down
2 changes: 2 additions & 0 deletions test/lib/brave.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ var exports = {
SHIFT: '\ue008',
BACKSPACE: '\ue003',
DELETE: '\ue017',
LEFT: '\ue012',
RIGHT: '\ue014',
DOWN: '\ue015',
UP: '\ue013',
PAGEDOWN: '\uE00F',
Expand Down
Loading

0 comments on commit 9ac2ff6

Please # to comment.