Skip to content

[fix] TextInput multiline defaults to 1 row - #2861

Open
u9g wants to merge 1 commit into
necolas:masterfrom
u9g:textinput-rows-default
Open

u9g wants to merge 1 commit into
necolas:masterfrom
u9g:textinput-rows-default

Conversation

@u9g

@u9g u9g commented Sep 25, 2026

Copy link
Copy Markdown

The docs for TextInput say rows defaults to 1, and it did: numberOfLines defaulted to 1 until 6795738 moved the default onto rows, and 7638301 then removed it from rows to let numberOfLines act as a fallback, leaving no final default. Since 0.19 a multiline input without rows/numberOfLines renders a <textarea> with no rows attribute, so browsers apply their own default of 2 rows, and a multiline input starts two lines tall on web while it starts one line tall on iOS and Android.

The fix restores the final fallback to 1 in the rows ?? numberOfLines ?? 1 chain. A test renders <TextInput multiline /> and checks rows="1".

npm run unit, lint and format pass for the package; flow could not be run locally (flow-bin has no arm64 build), so relying on CI for it.

The docs state that 'rows' defaults to 1, and it did until the prop
fallback refactor in 7638301 dropped the final default. Since then a
multiline TextInput without 'rows' or 'numberOfLines' renders a textarea
with no 'rows' attribute, so browsers apply their default of 2 rows.
@codesandbox-ci

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 60637fe:

Sandbox Source
react-native-web-examples Configuration

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant