Stay organized with collections
Save and categorize content based on your preferences.
blockly > Events > CommentMove > setReason
Sets the reason for a move event.
Signature:
setReason(reason: string[]): void;
Parameters
Parameter |
Type |
Description |
reason |
string[] |
Why is this move happening? 'drag', 'bump', 'snap', ... |
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\u003eEvents.CommentMove.setReason()\u003c/code\u003e method is used to explain the cause of a comment's movement within a Blockly workspace.\u003c/p\u003e\n"],["\u003cp\u003eIt accepts a string array representing the reason for the move, such as 'drag', 'bump', or 'snap'.\u003c/p\u003e\n"],["\u003cp\u003eThis method does not return any value and is used to add context to comment move events for debugging or analysis.\u003c/p\u003e\n"]]],["The `setReason()` method within the `Events.CommentMove` class configures the reason behind a comment's movement. It accepts a `string[]` named `reason` as a parameter, which details why the move is occurring. Examples of reasons include 'drag', 'bump', or 'snap'. This method does not return any value, indicated by `void`. The method essentially labels the motive for a comment move event.\n"],null,["[blockly](./blockly.md) \\\u003e [Events](./blockly.events_namespace.md) \\\u003e [CommentMove](./blockly.events_namespace.commentmove_class.md) \\\u003e [setReason](./blockly.events_namespace.commentmove_class.setreason_1_method.md)\n\nEvents.CommentMove.setReason() method\n\nSets the reason for a move event.\n\n**Signature:** \n\n setReason(reason: string[]): void;\n\nParameters\n\n| Parameter | Type | Description |\n|-----------|------------|---------------------------------------------------------|\n| reason | string\\[\\] | Why is this move happening? 'drag', 'bump', 'snap', ... |\n\n**Returns:**\n\nvoid"]]