TextArea
23 Sep 20255 minutes to read
Properties
cols number
specifies the visible width of the textarea, measured in average character widths.
cssClass string
Specifies the CSS class value that is appended to wrapper of Textbox.
Defaults to ’’
enablePersistence boolean
Enable or disable persisting TextArea state between page reloads. If enabled, the value state will be persisted.
Defaults to false
enableRtl boolean
Enable or disable rendering component in right to left direction.
Defaults to false
enabled boolean
Specifies a Boolean value that indicates whether the TextArea allow user to interact with it.
Defaults to true
floatLabelType FloatLabelType
Specifies the floating label behavior of the TextArea that the placeholder text floats above the TextArea based on the below values.
Possible values are:
-
Never- The placeholder text should not be float ever. -
Always- The placeholder text floats above the TextArea always. -
Auto- The placeholder text floats above the TextArea while focusing or enter a value in TextArea.
Defaults to Never
htmlAttributes { : }
You can add the additional html attributes such as disabled, value etc., to the element.
If you configured both property and equivalent html attribute then the component considers the property value.
Defaults to {}
locale string
Overrides the global culture and localization value for this component. Default global culture is ‘en-US’.
Defaults to ’’
maxLength number
Specifies the maximum number of characters allowed in TextArea.
placeholder string
Specifies the text that is shown as a hint/placeholder until the user focus or enter a value in TextArea.
The property is depending on the floatLabelType property.
Defaults to null
readonly boolean
Specifies the boolean value whether the TextArea allows user to change the text.
Defaults to false
resizeMode Resize
Specifies the resize mode of textarea.
possible values are:
-
Vertical- The textarea element can be resized vertically. -
Horizontal- The textarea element can be resized horizontally. -
Both- The textarea element can be resized both vertically and horizontally. -
None- The textarea element cannot be resized.
Defaults to Both
rows number
specifies the visible height of the textarea, measured in lines
showClearButton boolean
Specifies a Boolean value that indicates whether the clear button is displayed in TextArea.
Defaults to false
value string
Sets the content of the TextArea.
Defaults to null
width number|string
Specifies the width of the TextArea component.
Defaults to null
Methods
addAttributes
Adding the multiple attributes as key-value pair to the TextArea element.
| Parameter | Type | Description |
|---|---|---|
| attributes | ` { : }` |
Specifies the attributes to be add to TextArea element. |
Returns void
addEventListener
Adds the handler to the given event listener.
| Parameter | Type | Description |
|---|---|---|
| eventName | string |
A String that specifies the name of the event |
| handler | Function |
Specifies the call to run when the event occurs. |
Returns void
appendTo
Appends the control within the given HTML element
| Parameter | Type | Description |
|---|---|---|
| selector (optional) |
string | HTMLElement
|
Target element where control needs to be appended |
Returns void
attachUnloadEvent
Adding unload event to persist data when enable persistence true
Returns void
dataBind
When invoked, applies the pending property changes immediately to the component.
Returns void
destroy
Removes the component from the DOM and detaches all its related event handlers.
Also, it maintains the initial TextArea element from the DOM.
Returns void
detachUnloadEvent
Removing unload event to persist data when enable persistence true
Returns void
focusIn
Sets the focus to widget for interaction.
Returns void
focusOut
Remove the focus from widget, if the widget is in focus state.
Returns void
getLocalData
Returns the persistence data for component
Returns any
getPersistData
Gets the properties to be maintained in the persisted state.
Returns string
getRootElement
Returns the route element of the component
Returns HTMLElement
handleUnload
Handling unload event to persist data when enable persistence true
Returns void
refresh
Applies all the pending property changes and render the component again.
Returns void
removeAttributes
Removing the multiple attributes as key-value pair to the TextArea element.
| Parameter | Type | Description |
|---|---|---|
| attributes | string[] |
Specifies the attributes name to be removed from TextArea element. |
Returns void
removeEventListener
Removes the handler from the given event listener.
| Parameter | Type | Description |
|---|---|---|
| eventName | string |
A String that specifies the name of the event to remove |
| handler | Function |
Specifies the function to remove |
Returns void
Inject
Dynamically injects the required modules to the component.
| Parameter | Type | Description |
|---|---|---|
| moduleList | Function[] |
? |
Returns void
Events
blur EmitType<FocusOutEventArgs>
Triggers when the TextArea has focus-out.
change EmitType<ChangedEventArgs>
Triggers when the content of TextArea has changed and gets focus-out.
created EmitType<Object>
Triggers when the TextArea component is created.
destroyed EmitType<Object>
Triggers when the TextArea component is destroyed.
focus EmitType<FocusInEventArgs>
Triggers when the TextArea gets focus.
input EmitType<InputEventArgs>
Triggers each time when the value of TextArea has changed.