Setting the value of a multiline TextInput with breaks when autocorrect suggestion present
See original GitHub issueOn iOS, when multline={true}
is set on a TextInput
, something wonky happens when the value of a TextInput
is programmatically modified (via setState
and the value
property of said TextInput
) and an autocorrect suggestion is present.
The value of the text input ends up being set to the combination of the autocorrect suggestion and the programmatic value. This only happens when multiline={true}
. When multiline={false}
, all is fine.
This seems only to be reproducible on iOS. ~I was not able to reproduce on the Snack iOS simulator.~ This can be reproduced using the software keyboard in the Snack iOS simulator.
React Native version: 0.59
Steps To Reproduce
- Add
multiline={true}
to aTextInput
- Try to programmatically change the value of the text input when an autocorrect suggestion is present.
- The value set programmatically will become a combination of the autocorrect value and the programmatic value.
Describe what you expected to happen:
I expected the programmatic value to be set in the text input, as it is when multiline={false}
.
Snack, code example, screenshot, or link to a repository:
https://snack.expo.io/@mhoran/6b56c3
Typing “Yo mh” and clicking the “Bananas!” text will result in the text box containing “Yo my oran”, instead of “Yo mhoran”. Changing multiline={true}
to multiline={false}
gives the expected behavior.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:13 (1 by maintainers)
Top GitHub Comments
@backmeupplz I’m sorry. I don’t work on iOS. I just work on Android. I hope somebody working on iOS will be bable to help you. Thanks a lot. Sorry I did not read the other emails. I wish you a good day. Fabrizio
about the info, I was referring to the output from react-native info which allows the bot to add a Tag. I use that tag to filter Android issues as I don’t work on iOS, but nevermind. Seems that the issue is tagged now. Thanks a lot.
I don’t think so, the repro should be enough. I wouldn’t expect anybody to solve this for you anytime soon though. If you need it fixed the best solution would be to put up a PR.