From 17e3871f9ae3e00d1dac1b83d50e30f892a13d7a Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Fri, 20 Oct 2017 15:39:36 -0400 Subject: [PATCH] TinyMCE: Assign dummy container during removal --- blocks/editable/tinymce.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/blocks/editable/tinymce.js b/blocks/editable/tinymce.js index 64d544a840be83..321a83a78be207 100644 --- a/blocks/editable/tinymce.js +++ b/blocks/editable/tinymce.js @@ -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; }