Don't pane focus when pane model is destroyed

This avoids a non-failure error message when resetting the environment
in some specs.
This commit is contained in:
Nathan Sobo
2017-04-17 15:50:27 -06:00
committed by Antonio Scandurra
parent 5b07334993
commit 15ecbed61f

View File

@@ -27,7 +27,7 @@ class PaneElement extends HTMLElement
subscribeToDOMEvents: ->
handleFocus = (event) =>
@model.focus() unless @isActivating or @contains(event.relatedTarget)
@model.focus() unless @isActivating or @model.isDestroyed() or @contains(event.relatedTarget)
if event.target is this and view = @getActiveView()
view.focus()
event.stopPropagation()