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 308e54f4bc7..35e60a58998 100644 --- a/addons/web_editor/static/src/js/editor/snippets.editor.js +++ b/addons/web_editor/static/src/js/editor/snippets.editor.js @@ -46,6 +46,7 @@ var SnippetEditor = Widget.extend({ xmlDependencies: ['/web_editor/static/src/xml/snippets.xml'], events: { 'click .oe_snippet_remove': '_onRemoveClick', + 'wheel': '_onMouseWheel', }, custom_events: { 'option_update': '_onOptionUpdate', @@ -895,6 +896,21 @@ var SnippetEditor = Widget.extend({ } } }, + /** + * Called when the 'mouse wheel' is used when hovering over the overlay. + * Disable the pointer events to prevent page scrolling from stopping. + * + * @private + * @param {Event} ev + */ + _onMouseWheel: function (ev) { + ev.stopPropagation(); + this.$el.css('pointer-events', 'none'); + clearTimeout(this.wheelTimeout); + this.wheelTimeout = setTimeout(() => { + this.$el.css('pointer-events', ''); + }, 250); + }, }); /**