diff --git a/addons/web_editor/static/src/js/wysiwyg/wysiwyg_iframe.js b/addons/web_editor/static/src/js/wysiwyg/wysiwyg_iframe.js index 967ace42d2e..b93e00f8808 100644 --- a/addons/web_editor/static/src/js/wysiwyg/wysiwyg_iframe.js +++ b/addons/web_editor/static/src/js/wysiwyg/wysiwyg_iframe.js @@ -147,6 +147,9 @@ patch(Wysiwyg.prototype, { .write(`${iframeContent}`); + // Closing the document might trigger a new 'load' event. + self.$iframe.off('load', onLoad); + self.$iframe[0].contentWindow.document.close(); }); self.options.document = self.$iframe[0].contentWindow.document; });