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

Commit

Permalink
don't empty urlbar when focused
Browse files Browse the repository at this point in the history
fix #4851

Auditors: @bbondy

Test Plan:
1. go to any site
2. click on the webview
3. hit cmd+L
4. verify that the urlbar is selected and is not blank
  • Loading branch information
diracdeltas committed Oct 17, 2016
1 parent a24dcad commit b949a84
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 0 additions & 1 deletion js/components/urlBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,6 @@ class UrlBar extends ImmutableComponent {
componentWillMount () {
ipc.on(messages.SHORTCUT_FOCUS_URL, (e) => {
// If the user hits Command+L while in the URL bar they want everything suggested as the new potential URL to laod.
windowActions.setUrlBarActive(true)
this.updateLocationToSuggestion()
windowActions.setUrlBarSelected(true)
// The urlbar "selected" might already be set in the window state, so subsequent Command+L won't trigger component updates, so this needs another DOM refresh for selection.
Expand Down
10 changes: 10 additions & 0 deletions test/components/navigationBarTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,16 @@ describe('navigationBar', function () {
return this.getAttribute(activeWebview, 'src').then((src) => src === page1)
})
})

it('urlbar shows webview url when focused', function * () {
var page1 = this.page1
yield blur(this.app.client)
yield this.app.client
.ipcSend('shortcut-focus-url')
yield this.app.client.waitUntil(function () {
return this.getValue(urlInput).then((val) => val === page1)
})
})
})

describe('with non-url input value', function () {
Expand Down

0 comments on commit b949a84

Please sign in to comment.