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

Commit 9ac2ff6

Browse files
committed
update urlbar value on selection change
fix #8865
1 parent bf55709 commit 9ac2ff6

File tree

3 files changed

+290
-122
lines changed

3 files changed

+290
-122
lines changed

app/renderer/components/navigation/urlBar.js

+7
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,13 @@ class UrlBar extends React.Component {
247247
this.lastSuffix = ''
248248
}
249249

250+
// if there is no selection then we are not in autocomplete
251+
// so make sure that this.lastValue is set to urlInput.value
252+
if (this.urlInput.selectionStart === this.urlInput.selectionEnd) {
253+
this.lastVal = this.urlInput.value
254+
this.lastSuffix = ''
255+
}
256+
250257
const selectionStart = this.urlInput.selectionStart
251258
const newValue = [
252259
this.lastVal.slice(0, selectionStart),

test/lib/brave.js

+2
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ var exports = {
106106
SHIFT: '\ue008',
107107
BACKSPACE: '\ue003',
108108
DELETE: '\ue017',
109+
LEFT: '\ue012',
110+
RIGHT: '\ue014',
109111
DOWN: '\ue015',
110112
UP: '\ue013',
111113
PAGEDOWN: '\uE00F',

0 commit comments

Comments
 (0)