anchor([anchors])

Class: TextArea. Method inherited from UIComponent.

Description:

Sets or gets the anchor style of the component that indicates how to resize this component based on the resizing parent component.
Anchor defines which sides (top, right, bottom, left) of the component stay attached to the parent's edge when parent gets resized.
Set anchors after the component and its ancestors are added to a container to ensure expected behaviour.

Parameters:

Name Type Description

[anchors]

string

Space-separated list of sides to anchor (e.g., "top left"). If omitted, returns the current anchor value.

Returns:

Returns this component when setting, or the current anchor string when getting value.

Type: this | string

Examples:

const txt1 = new TextArea().anchor("top left right"); // Horizontally resizable
const txt2 = new TextArea().anchor("top left bottom"); // Vertically resizable