Open mlcpro opened 4 months ago
:warning: | Newer Version of React Native is Available! |
---|---|
:information_source: | You are on a supported minor version, but it looks like there's a newer patch available - 0.73.8. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases. |
Having the same issue on react-native 0.72.13 with multiline
Very annoying bug. You can check this topic: https://github.com/facebook/react-native/issues/36494 I guess it's the same, and there are some workarounds for this issue.
Very annoying bug. You can check this topic: #36494 I guess it's the same, and there are some workarounds for this issue.
Yes I have already seen this issue, as it is closed I re-opened the subject because the problem is still present
@mlcpro Could not reproduce issue on latest version. Can you please verify with latest version and provide a reproducer app created from reproducer-template?
@mlcpro Could not reproduce issue on latest version. Can you please verify with latest version and provide a reproducer app created from reproducer-template?
@kunalchavhan Of course, I just did the test, I confirm in the latest version (0.74.2) the bug is still present, please see reproducer template
@mlcpro Thanks for providing reproducer. The issue is clearly getting reproduced.
@mlcpro @cortinico While debugging the issue i found , in the below code snippet onChangeText callback never gets called if i am changing input via state in Fabric new arch , before providing the solution for old-arch i want to confirm if this is the expected behaviour in Fabric.
<View style={styles.input}> <Button onPress={() => setDescription1('HelloWorld')} title="Change text" /> <TextInput multiline={true} maxLength={18} value={description1} onChangeText={(text) => { console.log(text); setDescription1(text); }} /> </View>
I am encountering the same issue, the part where the value is modified incorrectly is causing me a lot of headaches.
For example, in my case, I have maxLength={8}
and if I type "Abcde"
and then programmtically set the state to empty string and navigate to another screen; and then coming back to the screen and programmatically setting the state to "Abcde"
again, the text input then incorrectly renders the string "AbcAbcde"
Which alternative solution works for you guys? Thanks in advance!
Description
I have noticed that when we have maxLength={number} and multiline={true}, if I manually modify my state with a long sentence, the onChangeText function is called 5 times, and furthermore, it modifies the initial value. Please take a look at the snack link I provided and see for yourself the value assigned to setDescription1 and the output value in the console.
Steps to reproduce
React Native Version
0.74.1
Affected Platforms
Runtime - iOS
Output of
npx react-native info
Stacktrace or Logs
Reproducer
reproducer-template snack
Screenshots and Videos
No response