Skip to content

Commit

Permalink
TinyMCE: Assign dummy container during removal
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth committed Oct 20, 2017
1 parent e869a9d commit 17e3871
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions blocks/editable/tinymce.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ export default class TinyMCE extends Component {
return;
}

// This hack prevents TinyMCE from trying to remove the container node
// while cleaning for destroy, since removal is handled by React. It
// does so by substituting the container to be removed.
this.editor.container = document.createDocumentFragment();
this.editor.destroy();
delete this.editor;
}
Expand Down

0 comments on commit 17e3871

Please sign in to comment.