Stay organized with collections
Save and categorize content based on your preferences.
blockly > DeleteArea > wouldDelete
DeleteArea.wouldDelete() method
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.
[[["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."],[[["\u003cp\u003eThe \u003ccode\u003ewouldDelete\u003c/code\u003e method determines if a dragged block or bubble would be deleted if dropped on a specific area.\u003c/p\u003e\n"],["\u003cp\u003eIt checks for deletability before drag events (\u003ccode\u003eonDragEnter\u003c/code\u003e, \u003ccode\u003eonDragOver\u003c/code\u003e, \u003ccode\u003eonDragExit\u003c/code\u003e) are triggered.\u003c/p\u003e\n"],["\u003cp\u003eThe method takes an \u003ccode\u003eIDraggable\u003c/code\u003e element (block or bubble) as input and returns \u003ccode\u003etrue\u003c/code\u003e if it would be deleted, otherwise \u003ccode\u003efalse\u003c/code\u003e.\u003c/p\u003e\n"]]],["The `wouldDelete()` method determines if a dragged block or bubble (`element`) would be deleted if dropped on a specific area. It checks if the `element` is deletable, and this check occurs before `onDragEnter`, `onDragOver`, and `onDragExit`. The method takes an `IDraggable` element as a parameter and returns a boolean value indicating whether the element would be deleted upon being dropped.\n"],null,["[blockly](./blockly.md) \\\u003e [DeleteArea](./blockly.deletearea_class.md) \\\u003e [wouldDelete](./blockly.deletearea_class.woulddelete_1_method.md)\n\nDeleteArea.wouldDelete() method\n-------------------------------\n\nReturns 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.\n\n**Signature:** \n\n wouldDelete(element: IDraggable): boolean;\n\nParameters\n----------\n\n| Parameter | Type | Description |\n|-----------|-------------------------------------------------|----------------------------------------------|\n| element | [IDraggable](./blockly.idraggable_interface.md) | The block or bubble currently being dragged. |\n\n**Returns:**\n\nboolean\n\nWhether the element provided would be deleted if dropped on this area."]]