Skip to main content

Home > blockly > DeleteArea

DeleteArea class

Abstract class for a component that can delete a block or bubble that is dropped on top of it.

Signature:

export declare class DeleteArea extends DragTarget implements IDeleteArea 

Extends: DragTarget

Implements: IDeleteArea

Constructors

ConstructorModifiersDescription
(constructor)()Constructor for DeleteArea. Should not be called directly, only by a subclass.

Properties

PropertyModifiersTypeDescription
idstringThe unique id for this component that is used to register with the ComponentManager.
wouldDelete_protectedbooleanWhether the last block or bubble dragged over this delete area would be deleted if dropped on this component. This property is not updated after the block or bubble is deleted.

Methods

MethodModifiersDescription
updateWouldDelete_(wouldDelete)protectedUpdates the internal wouldDelete_ state.
wouldDelete(element)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.