Stay organized with collections
Save and categorize content based on your preferences.
blockly > IDragTarget
IDragTarget interface
Interface for a component with custom behaviour when a block or bubble is dragged over or dropped on top of it.
Signature:
export interface IDragTarget extends IComponent
Extends: IComponent
Methods
Method |
Description |
getClientRect() |
Returns the bounding rectangle of the drag target area in pixel units relative to viewport. |
onDragEnter(dragElement) |
Handles when a cursor with a block or bubble enters this drag target. |
onDragExit(dragElement) |
Handles when a cursor with a block or bubble exits this drag target. |
onDragOver(dragElement) |
Handles when a cursor with a block or bubble is dragged over this drag target. |
onDrop(dragElement) |
Handles when a block or bubble is dropped on this component. Should not handle delete here. |
shouldPreventMove(dragElement) |
Returns whether the provided block or bubble should not be moved after being dropped on this component. If true, the element will return to where it was when the drag started. |
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 2023-06-23 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{"lastModified": "Last updated 2023-06-23 UTC."}