       if fieldToFocus
         fieldToFocus.focus()
       else if focusEditorAfter
-        atom.workspaceView.focus()
+        workspaceElement = atom.views.getView(atom.workspace)
+        workspaceElement.focus()
       else
         @findEditor.focus()
 


  didHide: ->
    @hideAllTooltips()
    atom.workspaceView.focus()
    atom.workspaceView.removeClass('find-visible')

  hideAllTooltips: ->
    @tooltipSubscriptions.dispose()


    @on 'focus', (e) => @findEditor.focus()
    @find('button').on 'click', =>
      workspaceElement = atom.views.getView(atom.workspace)
      workspaceElement.focus()

  handleFindEvents: ->
    @findEditor.getModel().onDidStopChanging => @liveSearch()
