Class TextArea
Text Area UI element.
Inheritance
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
public class TextArea : ExVisualElement, IEventHandler, IVisualElementScheduler, IExperimentalFeatures, ITransitionAnimations, ITransform, IResolvedStyle, IContextOverrideElement, IAdditionalDataHolder, IInputElement<string>, IValidatableElement<string>, INotifyValueChanging<string>, INotifyValueChanged<string>
Constructors
TextArea()
Default constructor.
Declaration
public TextArea()
TextArea(string)
Construct a TextArea with a predefined text value.
Declaration
public TextArea(string value)
Parameters
Type | Name | Description |
---|---|---|
string | value | A default text value. |
Remarks
No event will be triggered when setting the text value during construction.
Fields
inputUssClassName
The TextArea input styling class.
Declaration
public const string inputUssClassName = "appui-textarea__input"
Field Value
Type | Description |
---|---|
string |
placeholderUssClassName
The TextArea placeholder styling class.
Declaration
public const string placeholderUssClassName = "appui-textarea__placeholder"
Field Value
Type | Description |
---|---|
string |
resizeHandleUssClassName
The TextArea resize handle styling class.
Declaration
public const string resizeHandleUssClassName = "appui-textarea__resize-handle"
Field Value
Type | Description |
---|---|
string |
scrollViewUssClassName
The TextArea input container styling class.
Declaration
public const string scrollViewUssClassName = "appui-textarea__scrollview"
Field Value
Type | Description |
---|---|
string |
ussClassName
The TextArea main styling class.
Declaration
public const string ussClassName = "appui-textarea"
Field Value
Type | Description |
---|---|
string |
Properties
autoResize
Automatically resize the Text
Declaration
public bool autoResize { get; set; }
Property Value
Type | Description |
---|---|
bool |
Remarks
This will only grow the Text
If the user manually resizes the Text
autoShrink
Whether the Text
Declaration
public bool autoShrink { get; set; }
Property Value
Type | Description |
---|---|
bool |
Remarks
To enable this feature, auto
contentContainer
The content container of the TextArea.
Declaration
public override VisualElement contentContainer { get; }
Property Value
Type | Description |
---|---|
Visual |
Overrides
invalid
The invalid state of the TextArea.
Declaration
public bool invalid { get; set; }
Property Value
Type | Description |
---|---|
bool |
isReadOnly
Whether the TextArea is read-only.
Declaration
public bool isReadOnly { get; set; }
Property Value
Type | Description |
---|---|
bool |
maxLength
The maximum length of the TextArea.
Declaration
public int maxLength { get; set; }
Property Value
Type | Description |
---|---|
int |
placeholder
The TextArea placeholder text.
Declaration
public string placeholder { get; set; }
Property Value
Type | Description |
---|---|
string |
submitModifiers
The modifiers required to submit the TextArea.
Declaration
public EventModifiers submitModifiers { get; set; }
Property Value
Type | Description |
---|---|
Event |
submitOnEnter
Whether the TextArea should invoke the submitted event when the user presses the Enter key.
Declaration
public bool submitOnEnter { get; set; }
Property Value
Type | Description |
---|---|
bool |
validateValue
The validation function for the TextArea.
Declaration
public Func<string, bool> validateValue { get; set; }
Property Value
value
The TextArea value.
Declaration
public string value { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
SetValueWithoutNotify(string)
Set the TextArea value without notifying the change.
Declaration
public void SetValueWithoutNotify(string newValue)
Parameters
Type | Name | Description |
---|---|---|
string | newValue | The new value of the TextArea. |
Events
submitted
Event triggered when the user presses the Enter key and submit
Declaration
public event Action submitted
Event Type
Type | Description |
---|---|
Action |