Stay organized with collections
Save and categorize content based on your preferences.
blockly > Field > getSvgRoot
Field.getSvgRoot() method
Gets the group element for this editable field. Used for measuring the size and for positioning.
Signature:
getSvgRoot(): SVGGElement | null;
Returns:
SVGGElement | null
The group element.
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\u003egetSvgRoot()\u003c/code\u003e method retrieves the SVG group element associated with an editable field.\u003c/p\u003e\n"],["\u003cp\u003eThis group element is crucial for determining the field's size and position within the Blockly workspace.\u003c/p\u003e\n"],["\u003cp\u003eThe method returns the \u003ccode\u003eSVGGElement\u003c/code\u003e representing the group, or \u003ccode\u003enull\u003c/code\u003e if it's not found.\u003c/p\u003e\n"]]],["The `getSvgRoot()` method, part of the Field class, retrieves the group element associated with an editable field. This element is crucial for tasks like determining the field's size and its placement within the interface. The method returns either an `SVGGElement`, representing the group element, or `null` if no such element exists. It's signature does not accept any parameters.\n"],null,["[blockly](./blockly.md) \\\u003e [Field](./blockly.field_class.md) \\\u003e [getSvgRoot](./blockly.field_class.getsvgroot_1_method.md)\n\nField.getSvgRoot() method\n-------------------------\n\nGets the group element for this editable field. Used for measuring the size and for positioning.\n\n**Signature:** \n\n getSvgRoot(): SVGGElement | null;\n\n**Returns:**\n\nSVGGElement \\| null\n\nThe group element."]]