     @closest('.pane').view()
 
   focus: ->
-    @component?.onFocus()
+    if @component?
+      @component.onFocus()
+    else
+      @focusOnAttach = true

module.exports =
class ReactEditorView extends View
  @content: -> @div class: 'editor react-wrapper'

  constructor: (@editor) ->
    super

      lines.addClass(klass)
      lines.length > 0

    @focus() if @focusOnAttach

    @trigger 'editor:attached', [this]

  pixelPositionForBufferPosition: (bufferPosition) ->
