Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Libraries/Components/TextInput/TextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,13 @@ type AndroidProps = $ReadOnly<{|
*/
returnKeyLabel?: ?string,

/**
* Sets the number of rows for a `TextInput`. Use it with multiline set to
* `true` to be able to fill the lines.
* @platform android
*/
rows?: ?number,

/**
* When `false`, it will prevent the soft keyboard from showing when the field is focused.
* Defaults to `true`.
Expand Down Expand Up @@ -1356,6 +1363,7 @@ function InternalTextInput(props: Props): React.Node {
disableFullscreenUI={props.disableFullscreenUI}
focusable={focusable}
mostRecentEventCount={mostRecentEventCount}
numberOfLines={props.rows ?? props.numberOfLines}
onBlur={_onBlur}
onChange={_onChange}
onFocus={_onFocus}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,12 +392,22 @@ exports.examples = ([
<TextInput
numberOfLines={2}
multiline={true}
placeholder="Two line input"
placeholder="Two line input using numberOfLines prop"
/>
<TextInput
numberOfLines={5}
multiline={true}
placeholder="Five line input"
placeholder="Five line input using numberOfLines prop"
/>
<TextInput
rows={2}
multiline={true}
placeholder="Two line input using rows prop"
/>
<TextInput
rows={5}
multiline={true}
placeholder="Five line input using rows prop"
/>
</View>
);
Expand Down