-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't work well if TextInput has initial value #1
Comments
I have the same issue |
Thanks guys. I investigated and tried to solve this issue and it seems that it's not a trivial fix in the JS code. Here's why: A multiline The only way I see to solve it would be to fix the native RN code to send the same event when the text is filled without user input. I found this relevant issue: facebook/react-native#6552. Not closed yet and if I understand correctly they still haven't decided on the proper fix and how it should be implemented between iOS and Android. While it's a pretty easy fix in the native code I don't think that another PR by me will help, especially when they already have several ideas, but if you vote for the issues it might help the RN team to prioritize it. Your thoughts? Any other suggestions/workarounds anyone might have are welcome. |
Yes it's an issue from RN, I don't see how you could fix it properly currently. I voted for the RN issue. Thanks for your work ! |
…is set pragmatically and not by the user typing the keyboard (issue #1)
Just pushed a fix that attempt to temporarily fix this issue (until it gets fixed in RN). Please try to update and see if it works. It requires using the some native code, see the README for installation instruction to use in your project. |
@artald Hello! Thanks for this module! I'm running it currently on RN 0.30 and it seems like native code fix doesn't work anymore. The component gets new height on initial value set, but it's not equal to desired height. I'm getting |
@roman01la Hey.. Since we use this component in our production code it will take some time until we upgrade to RN 30, so a fix at this point will have to back backwards compatible. As always, PRs are most welcome.. |
…ated to issue #1) This is a temporary JS hack for Android (temporary hack for iOS was implemented natively). After moving to RN > 30 we can probably remove all the hacks.
@artald I was trying your solution from ReadMe.md but it didn't
|
I also still have this issue where a multiline TextInput does not get initialized with its value prop's value, resulting in a flicker when navigating to the screen containing it. The TextInput has a preset value of a long poem, but for a few milliseconds, the empty TextInput is visible, resulting in a flicker On iPhone 12 Pro Max |
Hi,
I have some initial multiline content that should be displayed in
TextInput
once it opened. Now autogrow-text-input always starts with empty state. This could be easily fixed by setting correct statethis.state = {text: this.props.value || '', height: 0};
but TextInput should also update its height on that time corresponding given content. Could you please investigate how to do it?The text was updated successfully, but these errors were encountered: