Skip to content

Commit

Permalink
Merge pull request #676 from creative-commoners/pulls/1.3/tiny-mind-c…
Browse files Browse the repository at this point in the history
…rushing-editor

FIX Ensure TinyMCE field changes are persisted before updating redux state
  • Loading branch information
robbieaverill authored Oct 8, 2018
2 parents 3a911aa + e06bb05 commit dd57ba2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions client/src/components/HtmlEditorField/HtmlEditorField.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ class HtmlEditorField extends TextField {
const { document, jQuery: $ } = window;
const unmountEvent = $.Event('EntwineElementsRemoved');
const editorElement = document.getElementById(this.getInputProps().id);
// Tell tinyMCE to persist changes into the text field
$(editorElement).entwine('ss').getEditor().save();
unmountEvent.targets = [editorElement];
// Ensure that redux knows of the latest changes before the editor is destroyed.
// This is pretty awful because TinyMCE triggers jQuery events which aren't picked up
Expand Down

0 comments on commit dd57ba2

Please sign in to comment.