Skip to content

Commit

Permalink
Merge pull request #3093 from WordPress/fix/3091-tinymce-destroy-cont…
Browse files Browse the repository at this point in the history
…ainer

TinyMCE: Assign dummy container during removal
  • Loading branch information
aduth authored Oct 23, 2017
2 parents 4183ae3 + 17e3871 commit 653e555
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 653e555

Please sign in to comment.