From 2911b395ee99bece6b348104fddf99207a51cea3 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Tue, 12 Aug 2014 16:56:16 -0600 Subject: [PATCH] Handle 'focus' events in ReactEditorView and transfer to the component Fixes #3234 --- src/react-editor-view.coffee | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/react-editor-view.coffee b/src/react-editor-view.coffee index 5a5189753..b2b0d90f9 100644 --- a/src/react-editor-view.coffee +++ b/src/react-editor-view.coffee @@ -10,6 +10,7 @@ class ReactEditorView extends View @content: (params) -> attributes = params.attributes ? {} attributes.class = 'editor react editor-colors' + attributes.tabIndex = -1 @div attributes focusOnAttach: false @@ -55,6 +56,11 @@ class ReactEditorView extends View lines.addClass(klass) lines.length > 0 + @on 'focus', => + if @component? + @component.onFocus() + else + @focusOnAttach = true getEditor: -> @editor @@ -143,12 +149,6 @@ class ReactEditorView extends View getPane: -> @parent('.item-views').parents('.pane').view() - focus: -> - if @component? - @component.onFocus() - else - @focusOnAttach = true - hide: -> super @pollComponentDOM()