Stay organized with collections
Save and categorize content based on your preferences.
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
Constructor |
Modifiers |
Description |
(constructor)() |
|
Constructor for DeleteArea. Should not be called directly, only by a subclass. |
Properties
Property |
Modifiers |
Type |
Description |
id |
|
string |
The unique id for this component that is used to register with the ComponentManager. |
wouldDelete_ |
protected |
boolean |
Whether 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
Method |
Modifiers |
Description |
updateWouldDelete_(wouldDelete) |
protected |
Updates 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. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[[["The `DeleteArea` class in Blockly manages the deletion of blocks or bubbles dropped onto it."],["It's an abstract class extending `DragTarget` and implementing `IDeleteArea`, meant to be subclassed."],["It uses a `wouldDelete_` property to track if a dragged element would be deleted upon release."],["The `wouldDelete` method determines if a given element is deletable when dragged over the area."],["It provides `updateWouldDelete_` to manage the internal deletion state."]]],[]]