From 56cddd70d15174d09d56b8fe6f8f895fd178286c Mon Sep 17 00:00:00 2001 From: Samuel Degueldre Date: Tue, 3 Mar 2020 09:54:01 +0000 Subject: [PATCH] [FIX] web_editor: stop snippet editors from finding widget in parent Because of the event propagating to an option's parent, a snippet option requesting a uservalue widget would also get back the corresponding widgets on the parent snippetEditor, this has the potential to cause unforeseen problems. This commit fixes that by stopping the event's propagation. closes odoo/odoo#46724 X-original-commit: 1441b3c2f4f935771b3210be82f7b471aa028b64 Signed-off-by: Quentin Smetz (qsm) --- addons/web_editor/static/src/js/editor/snippets.editor.js | 1 + 1 file changed, 1 insertion(+) 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 9d11a7ac4c7..5afbe1cedfc 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -774,6 +774,7 @@ var SnippetEditor = Widget.extend({ * @param {Event} ev */ _onUserValueWidgetRequest: function (ev) { + ev.stopPropagation(); for (const key of Object.keys(this.styles)) { const widget = this.styles[key].findWidget(ev.data.name); if (widget) {