Skip to content

TextInput multiline text does not appear centered if only one line #3752

@paperskyline

Description

@paperskyline

Current behaviour

When TextInput has multiline prop, the text is vertically aligned towards the top if the input field contains only one line (screenshot 1). If the text is longer and shows two or more lines, then everything appears fine and the content is centered accordingly. (screenshot 2). You can see from the image below where i marked the spacings in red

Expected behaviour

Text Should be centered inside the the TextInput even if it contains text which takes up only a single line.

How to reproduce?

<TextInput multiline mode='outlined' style={{ paddingRight: 10, paddingLeft: 10, fontSize: 16, color: 'black', backgroundColor: 'grey' }} dense />

Preview

Screenshot 2023-03-14 at 1 41 01 PM
Screenshot 2023-03-14 at 1 41 19 PM

What have you tried so far?

textAlignVertical="center" did not work. Couldn't find other issues similar to this.

Your Environment

software version
ios 16
android 11
react-native 0.66.5
react-native-paper 4.11.2
node 16.17.0
npm or yarn 1.22.19

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions