-
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
Using toUpperCase
or textTransform: 'uppercase'
breaks on an Android controlled TextInput
#27449
Using toUpperCase
or textTransform: 'uppercase'
breaks on an Android controlled TextInput
#27449
Comments
Yeah. The same issue! On iOS all works fine |
Same issue for me.... |
Had same issue. Adding |
Any luck finding a workaround for this?? |
Seems to be the only workaround for me with Android at the moment (I've been looking for ages!). Will need some cross platform testing locally though. |
Really weird, it worked but I think that should be fixed asap.
|
i have the same problem. The solution by simon-davies-avtura solved it partially, but I really wanted to use |
seems similar issue to #11068 (comment) It is difficult to fix this issue related to Rich Text, more info in Pull Request #27757 |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions. |
This issue is still present in React Native version: |
I have the same problem. |
|
Hello ReactNative Developers! 😃 I just prepared Pull Request #29070 that seems to solve this issue
You can contact me by email at fabrizio.developer@gmail.com Please head over to the Pull Request #29070 and thumbs up if you like it. If you don't like the pr please feel free to leave a code review or comment, I'll be happy to add improvements and changes. Thanks a lot 🙏 ☮️ 🏖️ |
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:
|
Text transform Example in React Native Table of content
https://infinitbility.com/react-native/text-transform-in-react-native |
I find a possible solution to my problem, the TextInput has a property autoCapitalize with the values 'words, sentences, characters', but the user can disable the uppercase in his keyboard so is necessary convert the value to uppercase when i want to save the data |
Any news on a fix ? |
The duplications of letters are still happening, |
The only thing that I can suggest for people stuck with this issue as me is that to apply TextInput's value formatting ( |
The issue still persists. I encountered the issue when using For me, the doubling only occurs when typing with the keyboard in capital letters. Each time a letter is pressed, the converted string is appended to the previous string for an unknown reason, instead of being overwritten. I have now tested some cases to try to help find the source of the issue.
So then, the conclusion is that the source of the issue arises when handling (internal) the UPDATE - Case 3:I've also just tested not using the
|
Some notes and an ugly fix for this:
This already helped the situation. Only the first letter was doubled. trying to type Boxer would change to 'bboxer'
And this fixed the doubling of letters. Text is blinking a bit but at least for me it worked otherwise just fine. |
@jukkahuuskonen Now try writing in all caps. I think you will be surprised. |
Not sure if I understood correctly, but it works just fine with me BOXER becomes boxer no problems except for the text blinking a bit (hence the 'ugly' in the fix). Of course I've only tested it with my Sony Xperia 5ii. |
@jukkahuuskonen You understood well. This seems like a good temporary hack. Good job.
|
yup, that can be problem. Didn't notice it myself. Also, if you type too fast a similiar problem occurs. It is really something the react-native-team should fix. The problem has been around for several years already... |
yes I got that bug also on RN 0.70.6 the first letter is doubled with .toLowerCase() (Android) |
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. |
Hi @cortinico , I think it is inside React-Native, part Android that there is this bug : can you please have a look ? |
Adding autoCapitalize={"none"} and keyboard type as visible-password works. Another thing to note is don't add autoCorrect={false} with this fix. |
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 |
hi, yes on
The problem is :
|
You have the same behaviour with the code that delegates the 'toLowercase' function elsewhere :
you get in console with typing "fgHj" : it as if there is a state inside the Textinput that is emerging back with an old memory not updated. |
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 |
Thank you but : |
The lib supports only 0.73 now, ill publish support for 0.74 soon thanks |
React Native version: 0.61.4 and lower
Trying to force capitalization of characters inside a TextInput is broken on Android.
autoCapitalize="characters"
doesn't seem to do anythingtoUpperCase
in the onChangeText hook causes duplication of letterstextTransform: 'uppercase'
in styles block causes the same duplication of letterstextTransform: 'uppercase'
in a non-controlled TextInput does nothingSteps To Reproduce
Describe what you expected to happen:
Characters should be capitalized
What actually happens:
Characters are capitalized and duplicated
Snack, code example, screenshot, or link to a repository:
https://snack.expo.io/@nmi09/rn-android-capitalize-input-bug
The text was updated successfully, but these errors were encountered: