textAlignVertical is not working in Input
See original GitHub issueDescribe the bug
I want to make a multiple-line text input with placeholder at the top of the input area. However, textAlignVertical
is not able to use since styles of the TextInput
can’t be override
To Reproduce <Input multiline style={{textAlignVertical:‘top’, height: 200}} />
Expected behavior The placeholder displays at the top of the input area
Current behavior
Additional context
I can fix the issue by adding a new overrideInputStyles
property of Input
, however, it seems the framework is not expecting to override the style of the TextInput
.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7
Top Results From Across the Web
textAlignVertical: center not working · Issue #26926 - GitHub
I am trying to vertically align the text inside a Text component. I tried pretty much everything ( textAlignVertical: 'center', alignItems:' ...
Read more >How to align text input correctly in react native? - Stack Overflow
The problem you'll have is that multiline TextInput aren't working correctly yet, and the docs are misleading. Please see this Github issue:.
Read more >textalignvertical not working in ios react native - Code Grepper
textalignvertical not working in ios react native ; 1. { ; 2. height: 30, ; 3. textAlignVertical: 'center', ; 4 ...Platform.select({ ; 5....
Read more >TextAlignVertical class - painting library - Flutter - Dart API docs
The vertical alignment of text within an input box. A single y value that can range from -1.0 to 1.0. -1.0 aligns to...
Read more >How to Vertically Center Text with CSS - W3Docs
To position text vertically positioned with CSS you can use vertical-align, line-height, transform properties, flexbox. Learn more methods. Try examples.
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
@palingheorghe I looked into this issue and realized that what is causing the placeholder to be centered is styles.inputContainer
inputContainer: { flexDirection: 'row', alignItems: 'center', justifyContent: 'center', }
been applied to inputViewStyle. Hence overriding them by passing{ justifyContent: "flex-start", alignItems: "flex-start" }
should fix the issue.Also I would open a PR to introduce a prop named textInputStyle on Input which allows TextInput styles to be overridden…
Closed because we’ve merged the PR into the
dev
branch. Thank you!