Skip to content

Retyping after TextInput.clear() brings back characters before the clear. #15450

Closed
@toytonic

Description

@toytonic

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

  • Target Platform: Android
  • Development Operating System: macOSX
  • Build tools: vscode, react-native-cli, android-studio, sdk: 23.0.1
  • Issue is specific to some android versions/devices: We could reproduce it with 'SM-G903F - 6.0.1'

Steps to Reproduce

  1. Implement a textinput with a clear function that calls 'textinputRef.clear()' on an input ref
  2. type something in the text field
  3. trigger that clear
  4. start typing in the exact same textinput

Expected Behavior

  1. ...
  2. Textinput shows characters I typed
  3. Texinput shows no characters
  4. Textinput shows only the caracters typed after the clear

Actual Behavior

  1. ...
  2. Textinput shows characters I typed
  3. TexInput shows no characters
  4. Textinput shows characters before the clear AND the characters typed after the clear

Reproducible Demo

https://snack.expo.io/HkCfLCYP-

The issue happens both with controlled and uncontrolled inputs.

Metadata

Metadata

Assignees

Labels

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