From 8ad736fe484be5c49cad5d4e03a359b4475e5849 Mon Sep 17 00:00:00 2001 From: Benjamin Vray Date: Thu, 5 Jan 2023 09:54:54 +0000 Subject: [PATCH] [FIX] web_editor: prevents dropping a snippet in a non-editable area Before this commit, it was possible to drop a snippet in a non-editable area (e.g. dynamic snippets). Steps to reproduce the bug: - Drop a "Dynamic Products" snippet in a page. - Drop a "Columns" snippet in the same page. - Moves a column from the "Columns" snippet into the "Dynamic Products" snippet thanks to the "drag and drop" button. - Bugs => It works when it shouldn't. task-3054763 closes odoo/odoo#113796 X-original-commit: 4d61c356b7deed7fd0b01cb817c274afe384c0ac Signed-off-by: Arthur Detroux (ard) --- addons/web_editor/static/src/js/editor/snippets.editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/js/editor/snippets.editor.js b/addons/web_editor/static/src/js/editor/snippets.editor.js index 52820cc033c..40567d586e4 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -2327,7 +2327,7 @@ var SnippetsMenu = Widget.extend({ $selectorSiblings = $(_.uniq(($selectorSiblings || $()).add($selectorChildren.children()).get())); } - var noDropZonesSelector = '[data-invisible="1"], .o_we_no_overlay, :not(:visible)'; + var noDropZonesSelector = '[data-invisible="1"], .o_we_no_overlay, :not(:visible), :not(:o_editable)'; if ($selectorSiblings) { $selectorSiblings.not(`.oe_drop_zone, .oe_drop_clone, ${noDropZonesSelector}`).each(function () { var data;