Interface: IDragTarget

Properties

getClientRect

Returns the bounding rectangle of the drag target area in pixel units relative to viewport.

Returns

nullable Blockly.utils.Rect The component's bounding box. Null if drag target area should be ignored.

onDragEnter

Handles when a cursor with a block or bubble enters this drag target.

Parameter

dragElement

Blockly.IDraggable

The block or bubble currently being dragged.

Value must not be null.

onDragExit

Handles when a cursor with a block or bubble exits this drag target.

Parameter

dragElement

Blockly.IDraggable

The block or bubble currently being dragged.

Value must not be null.

onDragOver

Handles when a cursor with a block or bubble is dragged over this drag target.

Parameter

dragElement

Blockly.IDraggable

The block or bubble currently being dragged.

Value must not be null.

onDrop

Handles when a block or bubble is dropped on this component. Should not handle delete here.

Parameter

dragElement

Blockly.IDraggable

The block or bubble currently being dragged.

Value must not be null.

shouldPreventMove

Returns whether the provided block or bubble should not be moved after being dropped on this component. If true, the element will return to where it was when the drag started.

Parameter

dragElement

Blockly.IDraggable

The block or bubble currently being dragged.

Value must not be null.

Returns

boolean Whether the block or bubble provided should be returned to drag start.