Skip to main content

Interface: IDragger

Defined in: packages/blockly/core/interfaces/i_dragger.ts:10

Methods index

MethodDescription
onDragStartHandles any drag startup.
onDragHandles dragging, including calculating where the element should actually be moved to.
onDragEndHandles any drag cleanup when a drag finishes normally.
onDragRevertHandles any drag cleanup when a drag is reverted.

Methods

onDragStart()

onDragStart(e?): IDraggable;

Defined in: packages/blockly/core/interfaces/i_dragger.ts:16

Handles any drag startup.

Parameters

ParameterTypeDescription
e?PointerEvent | KeyboardEventEvent that started the drag.

Returns

IDraggable


onDrag()

onDrag(e, totalDelta): void;

Defined in: packages/blockly/core/interfaces/i_dragger.ts:26

Handles dragging, including calculating where the element should actually be moved to.

Parameters

ParameterTypeDescription
ePointerEvent | KeyboardEvent | undefinedEvent that continued the drag.
totalDeltaCoordinateThe total distance, in pixels, that the draggable has moved since the start of the drag.

Returns

void


onDragEnd()

onDragEnd(e, totalDelta): void;

Defined in: packages/blockly/core/interfaces/i_dragger.ts:38

Handles any drag cleanup when a drag finishes normally.

Parameters

ParameterTypeDescription
ePointerEvent | KeyboardEvent | undefinedEvent that finished the drag.
totalDeltaCoordinateThe total distance, in pixels, that the draggable has moved since the start of the drag.

Returns

void


onDragRevert()

onDragRevert(e, totalDelta): void;

Defined in: packages/blockly/core/interfaces/i_dragger.ts:50

Handles any drag cleanup when a drag is reverted.

Parameters

ParameterTypeDescription
ePointerEvent | KeyboardEvent | undefinedEvent that finished the drag.
totalDeltaCoordinateThe total distance, in pixels, that the draggable has moved since the start of the drag.

Returns

void