mirror of
https://github.com/atom/atom.git
synced 2026-01-23 22:08:08 -05:00
Always focus active pane item when pane is activated
Signed-off-by: Nathan Sobo <nathan@github.com>
This commit is contained in:
@@ -162,6 +162,10 @@ describe "PaneElement", ->
|
||||
paneElement.focus()
|
||||
expect(document.activeElement).toBe item
|
||||
|
||||
document.body.focus()
|
||||
pane.activate()
|
||||
expect(document.activeElement).toBe item
|
||||
|
||||
it "makes the pane active", ->
|
||||
pane.splitRight()
|
||||
expect(pane.isActive()).toBe false
|
||||
|
||||
@@ -27,7 +27,7 @@ class PaneElement extends HTMLElement
|
||||
|
||||
subscribeToDOMEvents: ->
|
||||
handleFocus = (event) =>
|
||||
@model.focus()
|
||||
@model.focus() unless @isActivating
|
||||
if event.target is this and view = @getActiveView()
|
||||
view.focus()
|
||||
event.stopPropagation()
|
||||
@@ -66,7 +66,9 @@ class PaneElement extends HTMLElement
|
||||
getModel: -> @model
|
||||
|
||||
activated: ->
|
||||
@focus() unless @hasFocus()
|
||||
@isActivating = true
|
||||
@focus()
|
||||
@isActivating = false
|
||||
|
||||
activeStatusChanged: (active) ->
|
||||
if active
|
||||
|
||||
Reference in New Issue
Block a user