[TextInput]How to get content height when TextInput has a defaultValue
See original GitHub issueI want to write a auto grow text input, i know onChange will pass contentSize in event.nativeEvent
<TextInput
onChange={event => {
event.nativeEvent.contentSize.height
}}
/>
but if input has a defaultValue, how to get the content height?
sorry for my english…
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:5 (4 by maintainers)
Top Results From Across the Web
React Native - TextInput - How to use value & defaultValue ...
Finally solved it,. The key is the following - "value" has preceding over "defaultValue" unless "value" is undefined!
Read more >TextInput
A foundational component for inputting text into the app via a keyboard. Props provide configurability for several features, ...
Read more >How to make an automatic increase in the width of the text ...
Coding example for the question How to make an automatic increase in the width of the text input field depending on the number...
Read more >TextInput · React Native Paper
A component to allow users to input text. ... Whether the input can have multiple lines. ... When height is passed, dense prop...
Read more >Text Input — Kivy 2.1.0 documentation
You can get the currently selected text from the TextInput.selection_text property. ... The previous default value False has been changed to True ....
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 Free
Top 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
Actually,
onLayout
is not triggered forTextInput
. Doing more testing, but first findings are negative…Hey @musicode and thanks for posting this! @damusnet tells me this issue looks like a question that would be best asked on StackOverflow. StackOverflow is amazing for Q&A: it has a reputation system, voting, the ability to mark a question as answered. Because of the reputation system it is likely the community will see and answer your question there. This also helps us use the GitHub bug tracker for bugs only. Will close this as this is really a question that should be asked on SO.