diff --git a/addons/web/static/src/core/utils/draggable_hook_builder.js b/addons/web/static/src/core/utils/draggable_hook_builder.js index 92f057b1a05..bc82bd1f42e 100644 --- a/addons/web/static/src/core/utils/draggable_hook_builder.js +++ b/addons/web/static/src/core/utils/draggable_hook_builder.js @@ -413,6 +413,14 @@ export function makeDraggableHook(hookParams = {}) { return; } + // In FireFox: elements with `overflow: hidden` will prevent mouseenter and mouseleave + // events from firing on elements underneath them. This is the case when dragging a card + // by the `.o_kanban_record_headings` element. In such cases, we can prevent the default + // action on the mousedown event to allow mouse events to fire properly. + // https://bugzilla.mozilla.org/show_bug.cgi?id=1352061 + // https://bugzilla.mozilla.org/show_bug.cgi?id=339293 + ev.preventDefault(); + ctx.currentContainer = ctx.ref.el; ctx.currentElement = ev.target.closest(ctx.elementSelector); diff --git a/addons/web/static/src/core/utils/draggable_hook_builder.scss b/addons/web/static/src/core/utils/draggable_hook_builder.scss index 657abf3138e..7c7a5e38fa2 100644 --- a/addons/web/static/src/core/utils/draggable_hook_builder.scss +++ b/addons/web/static/src/core/utils/draggable_hook_builder.scss @@ -1,14 +1,5 @@ .o_dragged { position: fixed !important; z-index: 1000 !important; - - // In FireFox: elements with `overflow: hidden` will prevent mouseenter and mouseleave - // events from firing on elements underneath them. This is the case when dragging a card - // by the `.o_kanban_record_headings` element. In such cases, the pointer events are - // disabled to allow mouse events to fire properly. - // https://bugzilla.mozilla.org/show_bug.cgi?id=1352061 - &, - * { - pointer-events: none; - } + pointer-events: none; }