File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed
Libraries/Components/TextInput
packages/rn-tester/js/examples/TextInput Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -452,6 +452,13 @@ type AndroidProps = $ReadOnly<{|
452452 */
453453 returnKeyLabel ?: ?string ,
454454
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+
455462 /**
456463 * When `false`, it will prevent the soft keyboard from showing when the field is focused.
457464 * Defaults to `true`.
@@ -1356,6 +1363,7 @@ function InternalTextInput(props: Props): React.Node {
13561363 disableFullscreenUI = { props . disableFullscreenUI }
13571364 focusable = { focusable }
13581365 mostRecentEventCount = { mostRecentEventCount }
1366+ numberOfLines = { props . rows ?? props . numberOfLines }
13591367 onBlur = { _onBlur }
13601368 onChange = { _onChange }
13611369 onFocus = { _onFocus }
Original file line number Diff line number Diff line change @@ -392,12 +392,22 @@ exports.examples = ([
392392 < TextInput
393393 numberOfLines = { 2 }
394394 multiline = { true }
395- placeholder = "Two line input"
395+ placeholder = "Two line input using numberOfLines prop "
396396 />
397397 < TextInput
398398 numberOfLines = { 5 }
399399 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"
401411 />
402412 </ View >
403413 ) ;
You can’t perform that action at this time.
0 commit comments