question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Setting the value of a multiline TextInput with breaks when autocorrect suggestion present

See original GitHub issue

On 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

  1. Add multiline={true} to a TextInput
  2. Try to programmatically change the value of the text input when an autocorrect suggestion is present.
  3. 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:open
  • Created 4 years ago
  • Reactions:1
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
fabriziobertoglio1987commented, Jul 21, 2020

@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.

1reaction
Ashoatcommented, Jun 30, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to wrap text within multiline react native textInput
I am trying to implement a multiline text input in react native, but when user types the text doesn't get wrapped but gets...
Read more >
Solved: Values from multiline text input fields are displa...
Solved: I have a powerapp form with a couple of text input controls. I have set the fields of the form to "Edit...
Read more >
I can't get predictive text and multiline text wor...
I can't get predictive text and multiline text working at the same time on Survey123 on Android app. Predictive text has been disabled...
Read more >
Accessible Rich Internet Applications (WAI-ARIA) 1.2
This is a Candidate Recommendation of WAI-ARIA 1.2 by the ... by getting and setting the current value of widget states and properties....
Read more >
Specify the input method type
Every text field expects a certain type of text input, such as an email address, phone number, or just plain text.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found