Re-render component when EditorView is reattached

Fixes #3640
This commit is contained in:
Nathan Sobo
2014-09-26 15:13:07 -06:00
parent 1f2fc4bf00
commit b5fc4aec84
2 changed files with 8 additions and 1 deletions

View File

@@ -95,7 +95,8 @@ class TextEditorView extends View
placeholderText: placeholderText
props = defaults({@editor, parentView: this}, props)
@component = React.renderComponent(TextEditorComponent(props), @element)
@componentDescriptor = TextEditorComponent(props)
@component = React.renderComponent(@componentDescriptor, @element)
node = @component.getDOMNode()
@@ -146,6 +147,7 @@ class TextEditorView extends View
return unless onDom
return if @attached
@attached = true
@component = React.renderComponent(@componentDescriptor, @element) unless @component.isMounted()
@component.checkForVisibilityChange()
@focus() if @focusOnAttach