File tree 2 files changed +20
-2
lines changed
Libraries/Components/TextInput
packages/rn-tester/js/examples/TextInput
2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -452,6 +452,13 @@ type AndroidProps = $ReadOnly<{|
452
452
*/
453
453
returnKeyLabel ?: ?string ,
454
454
455
+ /**
456
+ * Sets the number of rows for a `TextInput`. Use it with multiline set to
457
+ * `true` to be able to fill the lines.
458
+ * @platform android
459
+ */
460
+ rows ?: ?number ,
461
+
455
462
/**
456
463
* When `false`, it will prevent the soft keyboard from showing when the field is focused.
457
464
* Defaults to `true`.
@@ -1356,6 +1363,7 @@ function InternalTextInput(props: Props): React.Node {
1356
1363
disableFullscreenUI = { props . disableFullscreenUI }
1357
1364
focusable = { focusable }
1358
1365
mostRecentEventCount = { mostRecentEventCount }
1366
+ numberOfLines = { props . rows ?? props . numberOfLines }
1359
1367
onBlur = { _onBlur }
1360
1368
onChange = { _onChange }
1361
1369
onFocus = { _onFocus }
Original file line number Diff line number Diff line change @@ -392,12 +392,22 @@ exports.examples = ([
392
392
< TextInput
393
393
numberOfLines = { 2 }
394
394
multiline = { true }
395
- placeholder = "Two line input"
395
+ placeholder = "Two line input using numberOfLines prop "
396
396
/>
397
397
< TextInput
398
398
numberOfLines = { 5 }
399
399
multiline = { true }
400
- placeholder = "Five line input"
400
+ placeholder = "Five line input using numberOfLines prop"
401
+ />
402
+ < TextInput
403
+ rows = { 2 }
404
+ multiline = { true }
405
+ placeholder = "Two line input using rows prop"
406
+ />
407
+ < TextInput
408
+ rows = { 5 }
409
+ multiline = { true }
410
+ placeholder = "Five line input using rows prop"
401
411
/>
402
412
</ View >
403
413
) ;
You can’t perform that action at this time.
0 commit comments