@@ -73,8 +73,8 @@ type Event = Object;
73
73
* types, such as a numeric keypad.
74
74
*
75
75
* The simplest use case is to plop down a `TextInput` and subscribe to the
76
- * `onChangeText` events to read the user input. There are also other events,
77
- * such as `onSubmitEditing` and `onFocus` that can be subscribed to. A simple
76
+ * `onChangeText` events to read the user input. There are also other events,
77
+ * such as `onSubmitEditing` and `onFocus` that can be subscribed to. A simple
78
78
* example:
79
79
*
80
80
* ```
@@ -97,7 +97,6 @@ type Event = Object;
97
97
* onSubmitEditing: true,
98
98
* };
99
99
*/
100
-
101
100
var TextInput = React . createClass ( {
102
101
propTypes : {
103
102
/**
@@ -115,32 +114,44 @@ var TextInput = React.createClass({
115
114
'characters' ,
116
115
] ) ,
117
116
/**
118
- * If false, disables auto-correct. Default value is true.
117
+ * If false, disables auto-correct. The default value is true.
119
118
*/
120
119
autoCorrect : PropTypes . bool ,
121
120
/**
122
- * If true, focuses the input on componentDidMount. Default value is false.
121
+ * If true, focuses the input on componentDidMount.
122
+ * The default value is false.
123
123
*/
124
124
autoFocus : PropTypes . bool ,
125
125
/**
126
126
* Set the position of the cursor from where editing will begin.
127
+ * @platorm android
127
128
*/
128
129
textAlign : PropTypes . oneOf ( [
129
130
'start' ,
130
131
'center' ,
131
132
'end' ,
132
133
] ) ,
134
+ /**
135
+ * Aligns text vertically within the TextInput.
136
+ * @platform android
137
+ */
133
138
textAlignVertical : PropTypes . oneOf ( [
134
139
'top' ,
135
140
'center' ,
136
141
'bottom' ,
137
142
] ) ,
138
143
/**
139
- * If false, text is not editable. Default value is true.
144
+ * If false, text is not editable. The default value is true.
145
+ * @platform ios
140
146
*/
141
147
editable : PropTypes . bool ,
142
148
/**
143
149
* Determines which keyboard to open, e.g.`numeric`.
150
+ *
151
+ * The following values work across platforms:
152
+ * - default
153
+ * - numeric
154
+ * - email-address
144
155
*/
145
156
keyboardType : PropTypes . oneOf ( [
146
157
// Cross-platform
@@ -160,6 +171,7 @@ var TextInput = React.createClass({
160
171
] ) ,
161
172
/**
162
173
* Determines how the return key should look.
174
+ * @platform ios
163
175
*/
164
176
returnKeyType : PropTypes . oneOf ( [
165
177
'default' ,
@@ -175,17 +187,20 @@ var TextInput = React.createClass({
175
187
'emergency-call' ,
176
188
] ) ,
177
189
/**
178
- * Limits the maximum number of characters that can be entered. Use this
190
+ * Limits the maximum number of characters that can be entered. Use this
179
191
* instead of implementing the logic in JS to avoid flicker.
192
+ * @platform ios
180
193
*/
181
194
maxLength : PropTypes . number ,
182
195
/**
183
196
* If true, the keyboard disables the return key when there is no text and
184
- * automatically enables it when there is text. Default value is false.
197
+ * automatically enables it when there is text. The default value is false.
198
+ * @platform ios
185
199
*/
186
200
enablesReturnKeyAutomatically : PropTypes . bool ,
187
201
/**
188
- * If true, the text input can be multiple lines. Default value is false.
202
+ * If true, the text input can be multiple lines.
203
+ * The default value is false.
189
204
*/
190
205
multiline : PropTypes . bool ,
191
206
/**
@@ -214,14 +229,9 @@ var TextInput = React.createClass({
214
229
*/
215
230
onSubmitEditing : PropTypes . func ,
216
231
/**
217
- * Invoked on mount and layout changes with {x, y, width, height}.
232
+ * Invoked on mount and layout changes with ` {x, y, width, height}` .
218
233
*/
219
234
onLayout : PropTypes . func ,
220
- /**
221
- * If true, the text input obscures the text entered so that sensitive text
222
- * like passwords stay secure. Default value is false.
223
- */
224
- password : PropTypes . bool ,
225
235
/**
226
236
* The string that will be rendered before text input has been entered
227
237
*/
@@ -230,17 +240,23 @@ var TextInput = React.createClass({
230
240
* The text color of the placeholder string
231
241
*/
232
242
placeholderTextColor : PropTypes . string ,
243
+ /**
244
+ * If true, the text input obscures the text entered so that sensitive text
245
+ * like passwords stay secure. The default value is false.
246
+ */
247
+ secureTextEntry : PropTypes . bool ,
233
248
/**
234
249
* See DocumentSelectionState.js, some state that is responsible for
235
250
* maintaining selection information for a document
251
+ * @platform ios
236
252
*/
237
253
selectionState : PropTypes . instanceOf ( DocumentSelectionState ) ,
238
254
/**
239
- * The value to show for the text input. TextInput is a controlled
255
+ * The value to show for the text input. TextInput is a controlled
240
256
* component, which means the native value will be forced to match this
241
- * value prop if provided. For most uses this works great, but in some
257
+ * value prop if provided. For most uses this works great, but in some
242
258
* cases this may cause flickering - one common cause is preventing edits
243
- * by keeping value the same. In addition to simply setting the same value,
259
+ * by keeping value the same. In addition to simply setting the same value,
244
260
* either set `editable={false}`, or set/update `maxLength` to prevent
245
261
* unwanted edits without flicker.
246
262
*/
@@ -253,6 +269,7 @@ var TextInput = React.createClass({
253
269
defaultValue : PropTypes . string ,
254
270
/**
255
271
* When the clear button should appear on the right side of the text view
272
+ * @platform ios
256
273
*/
257
274
clearButtonMode : PropTypes . oneOf ( [
258
275
'never' ,
@@ -262,22 +279,25 @@ var TextInput = React.createClass({
262
279
] ) ,
263
280
/**
264
281
* If true, clears the text field automatically when editing begins
282
+ * @platform ios
265
283
*/
266
284
clearTextOnFocus : PropTypes . bool ,
267
285
/**
268
- * If true, selected the text automatically when editing begins
286
+ * If true, all text will automatically be selected on focus
287
+ * @platform ios
269
288
*/
270
289
selectTextOnFocus : PropTypes . bool ,
271
290
/**
272
291
* Styles
273
292
*/
274
293
style : Text . propTypes . style ,
275
294
/**
276
- * Used to locate this view in end-to-end tests.
295
+ * Used to locate this view in end-to-end tests
277
296
*/
278
297
testID : PropTypes . string ,
279
298
/**
280
- * The color of the textInput underline. Is only supported on Android.
299
+ * The color of the textInput underline.
300
+ * @platform android
281
301
*/
282
302
underlineColorAndroid : PropTypes . string ,
283
303
} ,
0 commit comments