[IMP] web: core: draggable: execute willStartDrag
Before this commit, the draggable hook did not execute willStartDrag, that is, before the element is actually moved. After this commit it does, allowing for implementing some features, like copyOnDrag. Part-of: odoo/odoo#115799
This commit is contained in:
@@ -43,6 +43,7 @@ import { pick } from "@web/core/utils/objects";
|
||||
/** @type {(params: DraggableParams) => DraggableState} */
|
||||
export const useDraggable = makeDraggableHook({
|
||||
name: "useDraggable",
|
||||
onWillStartDrag: ({ctx}) => pick(ctx.current, "element"),
|
||||
onDragStart: ({ ctx }) => pick(ctx.current, "element"),
|
||||
onDrag: ({ ctx }) => pick(ctx.current, "element"),
|
||||
onDragEnd: ({ ctx }) => pick(ctx.current, "element"),
|
||||
|
||||
Reference in New Issue
Block a user