The TextEditable component wraps inline text to allow it to be edited using the HTML contenteditable property. Newlines are replaced with the empty string.
Props
| Name | Type | Default value | Required? | Description |
|---|---|---|---|---|
value |
String | - | No | Text content. |
enabled |
Boolean | true |
No | Whether the content can be edited. |
Methods
-
input(e)
-
Set the content to a new value.
Parameters:
Name Type Description eEvent -
keydown(e) → {boolean|void}
-
Catch keydown events and translate 'enter' to signal completed input.
Parameters:
Name Type Description eKeyboardEvent Returns:
boolean | void - Whether to continue event bubbling.