Interface: IDeleteArea

Properties

getClientRect

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

Inherited from
Blockly.IDragTarget#getClientRect
Returns

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

The block or bubble currently being dragged.

Value must not be null.

Inherited from
Blockly.IDragTarget#onDragEnter

onDragExit

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

Parameter

dragElement

The block or bubble currently being dragged.

Value must not be null.

Inherited from
Blockly.IDragTarget#onDragExit

onDragOver

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

Parameter

dragElement

The block or bubble currently being dragged.

Value must not be null.

Inherited from
Blockly.IDragTarget#onDragOver

onDrop

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

Parameter

dragElement

The block or bubble currently being dragged.

Value must not be null.

Inherited from
Blockly.IDragTarget#onDrop

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

The block or bubble currently being dragged.

Value must not be null.

Inherited from
Blockly.IDragTarget#shouldPreventMove
Returns

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

wouldDelete

Returns whether the provided block or bubble would be deleted if dropped on this area. This method should check if the element is deletable and is always called before onDragEnter/onDragOver/onDragExit.

Parameter

element

Blockly.IDraggable

The block or bubble currently being dragged.

Value must not be null.

couldConnect

boolean

Whether the element could could connect to another.

Returns

boolean Whether the element provided would be deleted if dropped on this area.