-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TextInput issues on Android after updating to version 0.63.0 #30503
Comments
Same here. We have just upgraded from Expo 37 to 39, and with it this major problem appeared. |
any news? |
We are experiencing this issue. However, slightly different is that we are using
This seems solved the issue. The first thing you probably could try out is populate the whole Hopefully this does help. |
Facing the same issue after upgrading to RN 0.63.4. |
We went through all of our apps and changed every form to Formik, mostly due to this issue. The lack of attention given to this issue is concerning. |
Also facing the same issue on 0.63.4. Had to downgrade to 0.62.2 to fix the issue in the meantime. |
I removed the props value and add defaultValue in TextInput. It's work for me |
To answer the question of when the pr #29070 which fixes this issue will be released in the next version of React Native, I suggest you to follow the discussions at https://github.com/react-native-community/releases/issues by subscribing to those threads. The process of releasing a new version with a bug fix is the following:
|
React Native v0.64.1 is out and there is still no fix. This is very concerning... |
Dark mode 6months ETA. And this since Nov 30th. |
Had this issue as well but using Recoil. Seems like it's related to Global State, I just refactored to the value and onTextChange all being linked to useState in the same component (i.e. local state only) and then utilizing a useEffect to update and keep Global State synced with the local state of the Textinput. This fixed all problems for me. |
In my case, it was an issue with React Native Paper. More info here: GitHub Issue |
An update on what I've found for anyone who might be looking into this. I've found that in TextInput.js,
If I set a breakpoint and check I haven't been able to figure out exactly where the duplication is happening. If I get more time to look into it I'll post an update here. |
This issue is solved with my pr |
@fabriziobertoglio1987, thanks! I completely missed your previous comment which said this 🤦 . Do you know if this might make it into 0.65.0, whenever that finally gets released? |
The purpose of this commit is to address the text entry issues that currently exist for the TextInput component, as described here: facebook/react-native#30503 A working workaround propose in that thread is to replace the "value" prop with "defaultValue".
Still an issue with RN 0.65, wow!. Any work arounds? |
) * Resolve render error This commit aims to fix the render error outlined here: #33057 (review) The "outside" changes that happen when text is changed in the BottomSheetTextControl component should not be called directly from that component. Instead, they're now called within the useEffect hook. * Replace "value" prop with "defaultValue" The purpose of this commit is to address the text entry issues that currently exist for the TextInput component, as described here: facebook/react-native#30503 A working workaround propose in that thread is to replace the "value" prop with "defaultValue". * Simplify component by removing unecessary hooks The introduction of the "defaultValue" prop in f6d9697 means that it's no longer necessary to keep the value in state. "defaultValue" allows for text to be automatically changed as it's typed. See: https://reactnative.dev/docs/textinput#defaultvalue We don't need to use "onChangeText" for the purpose of updating the input's text and can instead use it to invoke the "onChange" function. We can also remove the useState and useEffect hooks, as they're not necessary to update the component's value.
this issue seems to still be up, has any workarounds been found? |
Try using defaultValue and supply a prop or a state like |
still |
Any solutions for RN0.64.1? |
Still happening on RN0.64.3, only on Android |
When TextBox is to be used as a controlled component, it fails in Android and iOS as well. iOS failure rate is smaller because of - I guess - the powerful hardware, but if written very quickly the cursor loses the correct spot. @hntddt123 's suggestion is very good but does not apply for the controlled components. Atomic example: import * as React from 'react';
import { View, Text, TextInput } from 'react-native';
export default function App() {
const [textInputEmail, setTextInputEmail] = React.useState('');
return (
<View style={{height: '100%', width: '100%', alignItems: 'center', justifyContent: 'center', }} >
<TextInput
label="Email"
value={textInputEmail}
onChangeText={email => setTextInputEmail(email.toLowerCase())}
style={{borderWidth: 4, width: '62%'}}
/>
</View>
);
} I am afraid there may be a fundamental architectural problem here. Any fix / suggestion is appreciated. |
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. |
This issue was closed because it has been stalled for 7 days with no activity. |
Do you still experience this issue? I have four years of experience maintaining facebook/react-native and I specialize in the Text and TextInput components. I currently have 58 facebook/react-native PRs. If you still experience this issue, I will prepare a patched release with the fix. Thanks a lot |
This PR is included in the react-native-improved library: react-native-improved
Set-upIn package.json "scripts": {
+ "postinstall": "yarn run react-native-patch"
} Then npmnpm install react-native-improved --save-dev yarn v1yarn add react-native-improved --dev |
Description
After upgrading from React Native version 0.62.2 to 0.63.0 users of my app started observing duplicate words when typing on a TextInput. This happens when using Samsung keyboard with predictive typing or auto-correct enabled, making text fields practically unusable. Google keyboard seems to at least let them type normally, although some glitches are visible there too. This bug didn't happen on React Native 0.62.x and it's particularly bad for my app whose main functionality is form filling. I have tested with the latest release and the issue still exists.
After browsing possible ways to fix this I resorted to setting the TextInput's
keyboardType
prop tovisible-password
on Android, thus disabling the auto-correct and typing suggestion functionality of the Samsung keyboard. However this is just a workaround for now.Due to the nature of my app (form filling) some memoization and re-rendering optimizations have to be done. I have provided the most minimal example of how this works on the sample repository linked below. The rationale is listed on the "Steps To Reproduce" section.
React Native version:
Steps To Reproduce
Provide a detailed list of steps that reproduce the issue.
Expected Results
Like I mentioned before, everything was working fine with my app prior to version 0.63.0. I noticed on the release notes some changes where made to the
TextInputState
but I don't see how these changes apply to my case. I need to access different sections of my Redux store, including the form module values, in many of my components.Snack, code example, screenshot, or link to a repository:
You can see my case and how the bug is reproduced on this repository: https://github.com/MHV1/rn-text-input-issue
Thank you for your help in advance :)
The text was updated successfully, but these errors were encountered: