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 b3630e4a2f5..9059f6945cd 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -2772,16 +2772,19 @@ var SnippetsMenu = Widget.extend({ // Without the `:not(.s_social_media)`, it is no longer possible to edit // icons in the social media snippet. This should be fixed in a more // proper way to get rid of this hack. - exclude += `${exclude && ', '}.o_snippet_not_selectable, .o_not_editable:not(.s_social_media) :not([contenteditable="true"])`; + exclude += `${exclude && ', '}.o_snippet_not_selectable`; let filterFunc = function () { - if (!$(this).is(exclude)) { - return true; + // Exclude what it is asked to exclude. + if ($(this).is(exclude)) { + return false; } + // `o_editable_media` bypasses the `o_not_editable` class. if (this.classList.contains('o_editable_media')) { return weUtils.shouldEditableMediaBeEditable(this); } - return false; + return !$(this) + .is('.o_not_editable:not(.s_social_media) :not([contenteditable="true"])'); }; if (target) { const oldFilter = filterFunc;