[FIX] web_tour: drag_and_drop_native: pass position to mousemove

Before this commit, the positions of the virtual pointer were not
passed to the mousemove event, preventing draggable code to correctly work.

After this commit, the Event is a proper MouseEvent, with clientX and clientY set
correctly.

X-original-commit: 2e60d1b733fd73021fb1dea490e6fa3ba2fc31d0
Part-of: odoo/odoo#102153
This commit is contained in:
Lucas Perais
2022-10-04 20:58:01 +02:00
parent 5805ca28a8
commit 5992fac7aa
@@ -171,7 +171,7 @@ var RunningTourActionHelper = core.Class.extend({
clientX: elementCenter.left,
clientY: elementCenter.top,
}));
element.dispatchEvent(new Event("mousemove", { bubbles: true, cancelable: true }));
element.dispatchEvent(new MouseEvent("mousemove", { bubbles: true, cancelable: true, clientX: toCenter.left, clientY: toCenter.top}));
to.dispatchEvent(new Event("mouseenter", { clientX: toCenter.left, clientY: toCenter.top }));
element.dispatchEvent(new Event("mouseup", {
bubbles: true,