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.

Android: Controlled TextInput Issue

See original GitHub issue

Description

On some Android’s, the controlled TextInput is not being controlled correctly, Tested on Samsung Galaxy S7( SM-G935F )

it seems to work on Numbers, Emoji, special chars … but only Characters [a-z], [A-Z] are affected, it resets every 4 characters press

exactly same as

Tested on iPhone 12, 11 ( working as expected )

Version

0.64.3

Output of react-native info

System: OS: Windows 10 10.0.19043 CPU: (12) x64 Intel® Core™ i7-10850H CPU @ 2.70GHz Memory: 14.74 GB / 31.61 GB Binaries: Node: 16.6.1 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.17 - ~\AppData\Roaming\npm\yarn.CMD npm: 7.20.3 - C:\Program Files\nodejs\npm.CMD Watchman: Not Found SDKs: Android SDK: Not Found Windows SDK: Not Found IDEs: Android Studio: Not Found Visual Studio: Not Found Languages: Java: 16.0.2 - /c/Program Files/Common Files/Oracle/Java/javapath/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.1 => 17.0.1 react-native: 0.64.3 => 0.64.3 react-native-windows: Not Found npmGlobalPackages: react-native: Not Found

Steps to reproduce

  • make new RN or Expo project
  • put controlled Text input ( with state )
  • open app in Samsung Galaxy S7( SM-G935F )
  • start typing

Snack, code example, screenshot, or link to a repository

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
vovkasmcommented, Dec 6, 2021

Can we close this?

@cortinico I vote for “no close please”, because OP set TextInput in uncontrolled mode by using defaultValue instead of value. So defaultValue is only workaround, not resolution for this issue. I can say that this issue was always here: lost of syncronization between native and JS state of input. To trigger issue before 0.62 we need to have heavy onChangeText callback, but since 0.62 (when TextInput war rewritten to Hooks & view commands replaces setNativeProps) issue araises even with tiny user code.

1reaction
github-actions[bot]commented, Jun 16, 2022

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

Read more comments on GitHub >

github_iconTop Results From Across the Web

android controlled text input not working as expected ...
on my Xiaomi a1 device, when trying to use a controlled textInput, the input goes crazy and start adding duplications of the current...
Read more >
There is an issue for using TextInput on android in react ...
When I tap TextInput view then screen is comes up like using keyboardavoidingview. it's on android, but on ios there is no any...
Read more >
Handle keyboard input
The Android system shows an on-screen keyboard—known as a soft input method—when a text field in your UI receives focus. To provide the...
Read more >
TextInput
This may cause issues with components that have position: 'absolute' while the keyboard is active. To avoid this behavior either specify ...
Read more >
Working with the EditText | CodePath Android Cliffnotes
Traditionally, the EditText hides the hint message (explained above) after the user starts typing. In addition, any validation error messages had to be...
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