Stay organized with collections
Save and categorize content based on your preferences.
blockly > IDragStrategy
IDragStrategy interface
Signature:
export interface IDragStrategy
Methods
Method |
Description |
drag(newLoc, e) |
Handles moving elements to the new location, and updating any visuals based on that (e.g connection previews for blocks). |
endDrag(e) |
Handles any drag cleanup, including e.g. connecting or deleting blocks. |
isMovable() |
Returns true iff the element is currently movable. |
revertDrag() |
Moves the draggable back to where it was at the start of the drag. |
startDrag(e) |
Handles any drag startup (e.g moving elements to the front of the workspace). |
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 `IDragStrategy` interface defines methods for managing the dragging behavior of elements, such as blocks, within a Blockly workspace."],["It includes methods for initiating, handling, and concluding drag operations, as well as reverting to the original position if necessary."],["The interface handles visual updates during the drag, like connection previews, and ensures elements are moved and cleaned up appropriately."],["`IDragStrategy` determines the movability of elements and enables the execution of specific actions based on drag events."]]],[]]