blockly > Toolbox > 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.
Signature:
wouldDelete(element: IDraggable): boolean;
Parameters
Parameter |
Type |
Description |
element |
IDraggable |
The block or bubble currently being dragged. |
Returns:
boolean
Whether the element provided would be deleted if dropped on this area.
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.
[null,null,["Last updated 2024-09-18 UTC."],[[["The `Toolbox.wouldDelete()` method determines if a dragged block or bubble would be deleted when dropped onto a specific area of the workspace."],["It utilizes the `IDraggable` interface to identify the element being dragged and returns a boolean value indicating whether deletion would occur."],["This check happens before any drag enter, drag over, or drag exit events, ensuring that deletion considerations are prioritized."]]],["The `Toolbox.wouldDelete()` method determines if a dragged block or bubble (`element`) would be deleted if dropped onto the toolbox area. It takes an `IDraggable` element as input and returns a boolean indicating whether deletion would occur. This method checks if the element is deletable and is invoked before drag-related events such as `onDragEnter`, `onDragOver`, and `onDragExit`.\n"]]