From 638d0e875dcb05191fe833d2f889235891dfb46a Mon Sep 17 00:00:00 2001 From: Benoit Socias Date: Mon, 20 Jun 2022 10:23:01 +0000 Subject: [PATCH] [FIX] web_editor: prevent dropping form fields outside of their form Drop zones are available outside form when dragging form fields. This leads to errors whenever the field is dropped outside a form. This commit removes all drop zones outside the form when a field is dragged. Steps to reproduce: - Edit Contact Us form. - Drag'n'drop a field to the footer. => Error popup (should not be allowed in the first place) task-2855670 closes odoo/odoo#108863 X-original-commit: 31aec4f89eea5f6095e420137c9603732674901c Signed-off-by: Quentin Smetz (qsm) Signed-off-by: Benoit Socias (bso) --- .../static/src/js/editor/snippets.editor.js | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 f2d6a2b40d5..86fadd1709a 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -1054,6 +1054,7 @@ var SnippetEditor = Widget.extend({ width: self.$target.width(), height: self.$target.height() }; + const closestFormEl = this.$target[0].closest('form'); self.$target.after('