Stay organized with collections
Save and categorize content based on your preferences.
blockly > IDragTarget > onDragEnter
IDragTarget.onDragEnter() method
Handles when a cursor with a block or bubble enters this drag target.
Signature:
onDragEnter(dragElement: IDraggable): void;
Parameters
Parameter |
Type |
Description |
dragElement |
IDraggable |
The block or bubble currently being dragged. |
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.
[[["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\u003eonDragEnter\u003c/code\u003e method is triggered when a draggable element (block or bubble) enters the boundaries of a drag target.\u003c/p\u003e\n"],["\u003cp\u003eThis method receives the currently dragged element (\u003ccode\u003eIDraggable\u003c/code\u003e) as an argument to allow for custom handling based on the dragged item.\u003c/p\u003e\n"],["\u003cp\u003eThe method does not return any value (\u003ccode\u003evoid\u003c/code\u003e) and primarily serves to initiate visual or logical responses upon drag enter.\u003c/p\u003e\n"]]],["The `onDragEnter` method, part of the `IDragTarget` interface, manages the event when a dragged element (either a block or bubble) enters the target area. It accepts a single parameter, `dragElement`, which is an `IDraggable` object representing the item being dragged. This method's core action is handling the entry, and it does not return any value, as indicated by the `void` return type.\n"],null,["[blockly](./blockly.md) \\\u003e [IDragTarget](./blockly.idragtarget_interface.md) \\\u003e [onDragEnter](./blockly.idragtarget_interface.ondragenter_1_methodsignature.md)\n\nIDragTarget.onDragEnter() method\n--------------------------------\n\nHandles when a cursor with a block or bubble enters this drag target.\n\n**Signature:** \n\n onDragEnter(dragElement: IDraggable): void;\n\nParameters\n----------\n\n| Parameter | Type | Description |\n|-------------|-------------------------------------------------|----------------------------------------------|\n| dragElement | [IDraggable](./blockly.idraggable_interface.md) | The block or bubble currently being dragged. |\n\n**Returns:**\n\nvoid"]]