Stay organized with collections
Save and categorize content based on your preferences.
blockly > dragging > Dragger
dragging.Dragger class
Signature:
export declare class Dragger implements IDragger
Implements: IDragger
Constructors
Properties
Methods
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 2025-05-16 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 2025-05-16 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eDragger\u003c/code\u003e class in Blockly manages the dragging behavior of elements within a workspace.\u003c/p\u003e\n"],["\u003cp\u003eIt implements the \u003ccode\u003eIDragger\u003c/code\u003e interface and provides methods for handling drag start, drag, and drag end events.\u003c/p\u003e\n"],["\u003cp\u003eDragger calculates element positions during dragging, updates the drag target, and determines if the draggable should return to its starting position or be deleted.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can extend or customize this class to modify the drag-and-drop functionality in Blockly applications.\u003c/p\u003e\n"]]],[],null,["[blockly](./blockly.md) \\\u003e [dragging](./blockly.dragging_namespace.md) \\\u003e [Dragger](./blockly.dragging_namespace.dragger_class.md)\n\ndragging.Dragger class\n----------------------\n\n**Signature:** \n\n export declare class Dragger implements IDragger \n\n**Implements:** [IDragger](./blockly.idragger_interface.md)\n\nConstructors\n------------\n\n| Constructor | Modifiers | Description |\n|------------------------------------------------------------------------------------------------------------------|-----------|--------------------------------------------------|\n| [(constructor)(draggable, workspace)](./blockly.dragging_namespace.dragger_class._constructor__1_constructor.md) | | Constructs a new instance of the `Dragger` class |\n\nProperties\n----------\n\n| Property | Modifiers | Type | Description |\n|---------------------------------------------------------------------------------|-------------|-------------------------------------------------------------|-------------|\n| [draggable](./blockly.dragging_namespace.dragger_class.draggable_property.md) | `protected` | [IDraggable](./blockly.idraggable_interface.md) | |\n| [dragTarget](./blockly.dragging_namespace.dragger_class.dragtarget_property.md) | `protected` | [IDragTarget](./blockly.idragtarget_interface.md) \\| null | |\n| [startLoc](./blockly.dragging_namespace.dragger_class.startloc_property.md) | `protected` | [Coordinate](./blockly.utils_namespace.coordinate_class.md) | |\n| [workspace](./blockly.dragging_namespace.dragger_class.workspace_property.md) | `protected` | [WorkspaceSvg](./blockly.workspacesvg_class.md) | |\n\nMethods\n-------\n\n| Method | Modifiers | Description |\n|-----------------------------------------------------------------------------------------------------------------------|-------------|-------------------------------------------------------------------------------------------------|\n| [onDrag(e, totalDelta)](./blockly.dragging_namespace.dragger_class.ondrag_1_method.md) | | Handles calculating where the element should actually be moved to. |\n| [onDragEnd(e)](./blockly.dragging_namespace.dragger_class.ondragend_1_method.md) | | Handles any drag cleanup. |\n| [onDragStart(e)](./blockly.dragging_namespace.dragger_class.ondragstart_1_method.md) | | Handles any drag startup. |\n| [pixelsToWorkspaceUnits(pixelCoord)](./blockly.dragging_namespace.dragger_class.pixelstoworkspaceunits_1_method.md) | `protected` | |\n| [shouldReturnToStart(e, rootDraggable)](./blockly.dragging_namespace.dragger_class.shouldreturntostart_1_method.md) | `protected` | Returns true if we should return the draggable to its original location at the end of the drag. |\n| [updateDragTarget(e)](./blockly.dragging_namespace.dragger_class.updatedragtarget_1_method.md) | `protected` | Updates the drag target under the pointer (if there is one). |\n| [wouldDeleteDraggable(e, rootDraggable)](./blockly.dragging_namespace.dragger_class.woulddeletedraggable_1_method.md) | `protected` | Returns true if we would delete the draggable if it was dropped at the current location. |"]]