TextInput with mode="outlined", how to use bigger height for multiline and how to remove the paddingTop
See original GitHub issueCurrent behaviour
Expected behaviour
I am setting height
in <TextInput multiline style={{height: 200, paddingTop: 0}} />
to have a bigger textarea field.
It seems that the padding top is forced by react native paper
Code sample
<TextInput multiline style={{height: 200, paddingTop: 0}} />
Reproduction
https://snack.expo.io/@kopax/blessed-popsicle
Screenshots (if applicable)
What have you tried
So far, I don’t see how to use my paddingTop
preference to fix the issue
Your Environment
software | version |
---|---|
ios or android | web |
react-native | expo sdk 36 |
react-native-paper | 3.6.0 |
node | 13 |
npm or yarn | 6.4.1 |
expo sdk | 36 |
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (3 by maintainers)
Top Results From Across the Web
How would I grow <TextInput> height upon text wrapping?
My answer is to use onContentSizeChange and numberOfLines props in TextInput, of course turn on multiline , this is my solution:
Read more >A complete guide to TextInput in React Native - LogRocket Blog
Learn how to implement React Native's TextInput component, customize it to collect user inputs, and style your fields with React Native ...
Read more >TextInput · React Native Paper
A component to allow users to input text. ... When you apply height prop in style the dense prop affects only paddingVertical inside...
Read more >TextInput - React Native
The most basic use case is to plop down a TextInput and subscribe to the ... input: { height: 40, margin: 12, borderWidth:...
Read more >padding-top - CSS: Cascading Style Sheets - MDN Web Docs
The padding-top CSS property sets the height of the padding area on the top of an element.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@OlimpiaZurek that comment does not fixed the forced paddingTop, or am I missing something? The paddingTop comes from the view that RNP have wrapped the textinput in, it is set at 8, and I can’t find a way to make it zero
I’ve hit this same issue. When using
mode="outlined"
the text is padding on the top, creating an undesirable user experience.My ultimate solution has been to hack together my own outlined TextInput, by extending the styles of the flat style, as seen here (using styled components):