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

Commit

Permalink
Maintain focus in the active pane when window blurs then refocuses (c…
Browse files Browse the repository at this point in the history
…lose #1869)
  • Loading branch information
pfrazee committed Dec 7, 2020
1 parent aa3cf18 commit 2d98642
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/bg/ui/tabs/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ class Tab extends EventEmitter {
definePrimaryPanePassthroughGetter(this, 'browserView')
definePrimaryPanePassthroughFn(this, 'loadURL')
definePrimaryPanePassthroughFn(this, 'reload')
definePrimaryPanePassthroughFn(this, 'focus')
definePrimaryPanePassthroughFn(this, 'captureScreenshot')
definePrimaryPanePassthroughFn(this, 'showInpageFind')
definePrimaryPanePassthroughFn(this, 'hideInpageFind')
Expand Down Expand Up @@ -176,6 +175,14 @@ class Tab extends EventEmitter {
// management
// =

focus () {
if (this.activePane) {
this.activePane.focus()
} else if (this.panes.length) {
this.panes[0].focus()
}
}

resize () {
if (this.isHidden || !this.isActive) return
this.layout.computePanesBounds(this.tabBounds)
Expand Down

0 comments on commit 2d98642

Please sign in to comment.