Skip to content

Android: Controlled TextInput Issue on Some Androids #19085

Closed
@Noitidart

Description

@Noitidart

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:

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

  1. Render <TextInput value="Hello" />
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugComponent: TextInputRelated to the TextInput component.Platform: AndroidAndroid applications.StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions