Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix false content updating
- Because TinyMCE is completely handling its own inner state, you cannot compare nextProps.content with this.props.content.  Instead you must compare with editor.getContent()
  • Loading branch information
JasonTolliver committed Jan 26, 2016
commit cc24267d45c2ba106c036a5f65893bea66fb30ec
5 changes: 3 additions & 2 deletions lib/components/TinyMCE.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ const TinyMCE = React.createClass({
this._init(clone(nextProps.config), nextProps.content);
return;
}
if (!isEqual(this.props.content, nextProps.content)) {
let editor = tinymce.EditorManager.get(this.id);

const editor = tinymce.EditorManager.get(this.id);
if (!isEqual(editor.getContent({format: 'raw'}), nextProps.content)) {
editor.setContent(nextProps.content);

editor.selection.select(editor.getBody(), true);
Expand Down