Description
- I have reviewed the documentation
- I have searched existing issues
- I am using the latest React Native version
All my tests are done on a real device.
On some Android's, the controlled TextInput
is not being controlled correctly and causes all kinds of problems. For demo I simplified it down to <TextInput value="Hello" />
, and now typing in this box you will see weird characters show momentarily.
Here are some bigger issues caused by this root issue:
- On autocomplete - new characters are introduced - Android autocomplete bug HandlebarLabs/code-and-coffee#15 (comment) (gif included)
- After ".clear" - and then tyep another character - old value comes back - Android autocomplete bug HandlebarLabs/code-and-coffee#15 (comment) (gif included)
- Another - I dont have a gif of yet, I use redux-form, when I have
enableReinitialize:true
andkeepDirtyOnReinitialize: true
. On first re-initialization, the field is getting changed even if it is dirty - only on first re-initialization, future re-initializations have no problem interestingly.
This has been impacting me in all RN versions (I think I started RN with something in the 50s). I have two Android devices. This bug happens to me only on one of them.
Environment
Environment:
OS: Windows 10
Node: 8.4.0
Yarn: 0.19.1
npm: 6.0.0
Watchman: Not Found
Xcode: N/A
Android Studio: Version 2.3.0.0 AI-162.3764568
Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: 0.55.3 => 0.55.3
Steps to Reproduce
- Render
<TextInput value="Hello" />
- Type in it, you will see flashes of bad text (characters you did not just push)
Here is a snack - https://snack.expo.io/@noitsnack/controlled-textinput-issue-on-some-androids
Expected Behavior
Only the character I just typed should flash. Flash because native side gets new character and then syncs with js, which is controlled value. (ideally we have no flash, but this is understandable, and this is not the goal of this issue)
Actual Behavior
Here is a gif, we see my original text gets "duplicated" on second character press.