The Editable Text component for Retool Apps
A click-to-edit input field to enter a single line of text.
Editable Text is a single-line input field for text values. It functions similarly to Text Input but renders as plain text until clicked.
Properties
All properties for this object with supported data types or values. You can write JavaScript almost anywhere in Retool to manipulate or read property values.
autoCapitalize
The type of automatic capitalization that the browser can automatically perform when using virtual or on-screen keyboards.
Type | string | ||||||||||
Format | Plain Text | ||||||||||
Mutability |
| ||||||||||
Allowed Values |
| ||||||||||
Default |
|
Examples
"words"
autoComplete
Whether the browser can perform autocomplete on the input field.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
autoFill
The data type of the input field for browsers to autofill if autoComplete
is true
.
Type | string | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Format | Plain Text | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Mutability |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Allowed Values |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Default |
|
Examples
"email"
editIcon
The icon to display that indicates an editable value.
Type | string | ||||
Format | Icon Key | ||||
Mutability |
| ||||
Default |
|
Examples
/icon:bold/interface-edit-write-1
enforceMaxLength
Whether to enforce the maximum length.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
iconAfter
The suffix icon to display.
Type | string | ||||
Format | Icon Key | ||||
Mutability |
| ||||
Default |
|
Examples
/icon:bold/shopping-gift
iconBefore
The prefix icon to display.
Type | string | ||||
Format | Icon Key | ||||
Mutability |
| ||||
Default |
|
Examples
/icon:bold/shopping-gift
id
The unique identifier (name).
Type | string | ||||
Format | Plain Text | ||||
Mutability |
| ||||
Default |
|
Examples
query1
button1
inputTooltip
The tooltip helper text to display below the input on focus.
Type | string | ||||
Format | Plain Text | ||||
Mutability |
| ||||
Default |
|
Examples
`Shift+Enter` to save, `Esc` to cancel
isHiddenOnDesktop
Whether to show or hide this object in the desktop layout.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
isHiddenOnMobile
Whether to show or hide this object in the mobile layout.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
labelPosition
The position of the label relative to the input field or value.
Type | string | |||||||||
Format | Plain Text | |||||||||
Mutability |
| |||||||||
Allowed Values |
| |||||||||
Default |
|
Examples
top
loading
Whether to display a loading indicator.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
maintainSpaceWhenHidden
Whether to take up space on the canvas if hidden
is true
.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
margin
The amount of margin to render outside.
Type | string | |||||||||
Format | Plain Text | |||||||||
Mutability |
| |||||||||
Allowed Values |
| |||||||||
Default |
|
Examples
4px 8px
maxLength
The maximum number of characters to allow.
Type | number | ||||
Format | Integer | ||||
Mutability |
| ||||
Default |
|
Examples
100
minLength
The minimum number of characters to allow.
Type | number | ||||
Format | Integer | ||||
Mutability |
| ||||
Default |
|
Examples
20
pattern
A regular expression (regex), without forward slashes around the pattern, to validate input if patternType
is regex
.
Type | string | ||||
Format | Regular Expression | ||||
Mutability |
| ||||
Default |
|
Examples
^[a-zA-Z0-9]+$
patternType
The pattern with which to validate the input.
Type | string | ||||||||
Format | Plain Text | ||||||||
Mutability |
| ||||||||
Allowed Values |
| ||||||||
Default |
|
placeholder
The text to display within the input field when there is no value.
Type | string | ||||
Format | string | ||||
Mutability |
| ||||
Default |
|
Examples
Enter a value
readOnly
Whether user input is read-only.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
required
Whether a value is required to be selected.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
showClear
Whether to display a button to clear the value of the input field.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
showInEditor
Whether the component remains visible in the editor if hidden
is true
.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
spellCheck
Whether the browser can perform spellcheck on the input field.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
style
Custom style options.
Type | object | ||||
Mutability |
|
textAfter
The suffix text to display.
Type | string | ||||
Format | Plain Text | ||||
Mutability |
| ||||
Default |
|
Examples
USD
px
@example.com
textBefore
The prefix text to display.
Type | string | ||||
Format | Plain Text | ||||
Mutability |
| ||||
Default |
|
Examples
$
Email address
SKU
tooltipText
The tooltip text to display next to the label on hover.
Type | string | ||||
Format | Markdown | ||||
Mutability |
| ||||
Default |
|
Examples
Submit
value
The current or default value.
Type | string | ||||||
Format | Plain Text | ||||||
Mutability |
| ||||||
Default |
|
Examples
Hello world!
Methods
JavaScript API methods for this object. You can write JavaScript almost anywhere in Retool and use methods to manipulate data and property values.
editableText.clearValidation()
Clear the validation message from the input field.
editableText.clearValidation()
Examples
Clear the validation message from editableText
.
editableText.clearValidation();
editableText.clearValue()
Clear the current values.
editableText.clearValue()
Examples
Clear the current value of editableText
.
editableText.clearValue();
editableText.focus()
Set focus on the input field.
editableText.focus()
Examples
Set focus on editableText
.
editableText.focus();
editableText.resetValue()
Reset the current value to the default value.
editableText.resetValue()
Examples
Reset the current value of editableText
.
editableText.resetValue();
editableText.scrollIntoView()
Scrolls the canvas or parent container so that the selected component appears in the visible area.
editableText.scrollIntoView(options)
Parameters
Object Properties
behavior
The scroll behavior.
Type | string | ||||||
Allowed Values |
|
block
The scroll position relative to the component.
Type | string | ||||||||||
Allowed Values |
|
Examples
Scroll the minimum amount to immediately bring editableText
into view.
editableText.scrollIntoView({behavior: 'auto', block: 'nearest'});
editableText.setValue()
Set the current value.
editableText.setValue(value)
Examples
Set the current value of editableText
to userValue
.
editableText.setValue(userValue);
Events
Events triggered by user interactions. You can configure event handlers in the IDE to trigger queries or other actions in response to events.
Event | Description |
---|---|
Blur | The input field is deselected. |
Change | The value is changed. |
Focus | The input field is selected. |