diff --git a/addons/web_editor/static/src/js/editor/snippets.options.js b/addons/web_editor/static/src/js/editor/snippets.options.js index 1905f2e2231..d259fcc3a72 100644 --- a/addons/web_editor/static/src/js/editor/snippets.options.js +++ b/addons/web_editor/static/src/js/editor/snippets.options.js @@ -38,6 +38,7 @@ const {SIZES, MEDIAS_BREAKPOINTS} = require('@web/core/ui/ui_service'); var qweb = core.qweb; var _t = core._t; const preserveCursor = OdooEditorLib.preserveCursor; +const descendants = OdooEditorLib.descendants; /** * @param {HTMLElement} el @@ -4983,6 +4984,9 @@ registry.layout_column = SnippetOptionWidget.extend({ let $row = this.$('> .row'); if (!$row.length) { const restoreCursor = preserveCursor(this.$target[0].ownerDocument); + for (const node of descendants(this.$target[0])) { + node.ouid = undefined; + } $row = this.$target.contents().wrapAll($('
')).parent().parent(); restoreCursor(); } @@ -4995,6 +4999,9 @@ registry.layout_column = SnippetOptionWidget.extend({ await new Promise(resolve => setTimeout(resolve)); if (nbColumns === 0) { const restoreCursor = preserveCursor(this.$target[0].ownerDocument); + for (const node of descendants($row[0])) { + node.ouid = undefined; + } $row.contents().unwrap().contents().unwrap(); restoreCursor(); this.trigger_up('activate_snippet', {$snippet: this.$target});