blockly > Block > dispose
Block.dispose() method
Dispose of this block.
Signature:
dispose(healStack?: boolean): void;
Parameters
Parameter |
Type |
Description |
healStack |
boolean |
(Optional) If true, then try to heal any gap by connecting the next statement with the previous statement. Otherwise, dispose of all children of this block. |
Returns:
void
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 `dispose()` method permanently removes a block from the workspace."],["It optionally takes a boolean argument, `healStack`, to determine whether to connect the surrounding blocks or dispose of all the block's children."],["By default, `healStack` is false, resulting in the removal of the block and all its nested components."],["When `healStack` is true, it attempts to maintain workspace continuity by connecting the preceding and succeeding blocks."]]],["The `Block.dispose()` method removes a block. It accepts an optional boolean parameter, `healStack`. If `healStack` is true, the method attempts to connect the next statement to the previous one, filling any gaps. If `healStack` is false or omitted, all child blocks of the disposed block are also removed. The method does not return any value.\n"]]