Skip to content

Commit

Permalink
Focus webview when ESC pressed on UrlBar
Browse files Browse the repository at this point in the history
  • Loading branch information
michalbe committed Feb 3, 2017
1 parent a2bfd26 commit 6d05ff3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/renderer/components/urlBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const urlParse = require('../../common/urlParse')

const ImmutableComponent = require('../../../js/components/immutableComponent')
const windowActions = require('../../../js/actions/windowActions')
const webviewActions = require('../../../js/actions/webviewActions')
const appActions = require('../../../js/actions/appActions')
const KeyCodes = require('../../common/constants/keyCodes')
const cx = require('../../../js/lib/classSet')
Expand Down Expand Up @@ -335,9 +336,11 @@ class UrlBar extends ImmutableComponent {

onKeyUp (e) {
switch (e.keyCode) {
case KeyCodes.ESC:
webviewActions.setWebviewFocused()
return
case KeyCodes.UP:
case KeyCodes.DOWN:
case KeyCodes.ESC:
return
}
if (this.isSelected()) {
Expand Down

0 comments on commit 6d05ff3

Please sign in to comment.