[add] TextInput support for selection

This commit is contained in:
Nicolas Gallagher
2016-10-28 23:37:19 -07:00
parent b46acd4f50
commit 2b826dc7f4
2 changed files with 58 additions and 24 deletions

View File

@@ -116,22 +116,13 @@ an argument to the callback handler. Fires before `onChange` callbacks.
**onSelectionChange**: function
Callback that is called when the text input's selection changes. The following
object is passed as an argument to the callback handler.
Callback that is called when the text input's selection changes. This will be called with
`{ nativeEvent: { selection: { start, end } } }`.
**onSubmitEditing**: function
Callback that is called when the keyboard's submit button is pressed.
```js
{
selectionDirection,
selectionEnd,
selectionStart,
nativeEvent
}
```
**placeholder**: string
The string that will be rendered in an empty `TextInput` before text has been
@@ -148,6 +139,10 @@ passwords stay secure.
(Not available when `multiline` is `true`.)
**selection**: { start: number, end: ?number }
The start and end of the text input's selection. Set start and end to the same value to position the cursor.
**selectTextOnFocus**: bool = false
If `true`, all text will automatically be selected on focus.