Skip to content
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

Controlled TextInput has problems with capitalising characters on iOS #19389

Closed
3 tasks done
jaaberg opened this issue May 22, 2018 · 21 comments
Closed
3 tasks done

Controlled TextInput has problems with capitalising characters on iOS #19389

jaaberg opened this issue May 22, 2018 · 21 comments
Labels
Component: TextInput Related to the TextInput component. Platform: iOS iOS applications. Resolution: Fixed A PR that fixes this issue has been merged. Resolution: Locked This issue was locked by the bot.

Comments

@jaaberg
Copy link

jaaberg commented May 22, 2018

When using a controlled TextInput and you end a message with either . or any other character that will make the next character being capitalised, and you go back to edit a word in the message you've already written, the next letters will always be capitalised, because it only looks at the last character in the message.

Environment

OS: macOS High Sierra 10.13.4
Node: 8.7.0
Yarn: 0.22.0
npm: 6.0.1
Watchman: 4.9.0
Xcode: Xcode 9.3.1 Build version 9E501
Android Studio: Not Found

Packages: (wanted => installed)
react: 16.3.0-alpha.1 => 16.3.0-alpha.1
react-native: https://github.com/expo/react-native/archive/sdk-26.0.0.tar.gz => 0.54.2

Steps to Reproduce

  1. Create a controlled TextInput (here's a snack)
  2. In the TextInput, write Hello Bruce. (edit: Important that you end with . (dot space) so that auto-capitalised is trigged)
  3. Place the cursor between Hello and Bruce., and try to write something, for instance there
  4. When you start to write, capitalise will automatically turn on, and if you turn it off, it will be on again for the next letter.

Expected Behavior

Non-capitalised letters.

Actual Behavior

Capitalise automatically turns on.

@laurent22
Copy link

laurent22 commented May 24, 2018

Could it be related to this recent commit? 8621d4b @TomSwift

@laurent22
Copy link

@jaaberg, have you find a way to fix or mitigate this issue by any chance?

@jaaberg
Copy link
Author

jaaberg commented Jun 10, 2018

Well, partly @laurent22. What I tried was to use TextInput as partly controlled by storing the value for every change in my redux store, but not feeding the value into the TextInput for every render. Instead I'm setting the value in componentDidMount with refs and native events like so:

this.textinput.setNativeProps({ text: this.props.text });

The problem is that since I'm building a chat, I need to clear the input field on submit. But it occurs that React Native also have a bug on clearing the TextInput (#18272) which makes that approach useless for me since I can't clear the value.

@Aleksefo
Copy link

Same issue appears in "react-native": "0.55.2".

@pribeh
Copy link

pribeh commented Jul 22, 2018

Experiencing the same issue on 0.55. It's really annoying users.

@Aleksefo
Copy link

Looks like the bug was fixed in v.0.56 ff70ecf

Tested in my app and it works as intended now.

@dchersey
Copy link
Contributor

This is still randomly re-occuring for some of my users for the chat app I have built using Gifted Chat. It's less frequent, but perhaps triggered by another sequence of actions. Anybody else?

@pribeh
Copy link

pribeh commented Jul 24, 2018

@dchersey are you running 0.56?

@hramos hramos added ⏪Old Version Resolution: Fixed A PR that fixes this issue has been merged. labels Jul 24, 2018
@hramos
Copy link
Contributor

hramos commented Jul 24, 2018

Fixed in ff70ecf.

@hramos hramos closed this as completed Jul 24, 2018
@dchersey
Copy link
Contributor

@pribeh yes I am.

@mcmar
Copy link

mcmar commented Aug 19, 2018

@dchersey We figured out what's triggering it. It's still happening in RN 0.56 when you have an emoji as the last character of your text input and then move the text cursor back (still with emoji as last character) and enter new letters somewhere in the middle of the string. It only capitalizes the letter i. Try that out and see if you can repro this issue.

@dchersey
Copy link
Contributor

dchersey commented Aug 19, 2018

@mcmar YES! That does cause it for me. I’ve asked my beta testers to try it as well but I expect the answer will be yes.

We are also seeing an intermittent issue where the keyboard goes into ALL CAPS in the middle of typing and can’t be reset. I believe it may also be related to going back and editing but haven’t been able to isolate that scenario precisely. Could this be related?

@pribeh
Copy link

pribeh commented Aug 19, 2018

@mcmar @dchersey I just reproduced it too.

@dchersey
Copy link
Contributor

dchersey commented Aug 19, 2018

@mcmar this happens if even if 😍 is not at end lIke 😀 this. Moving the cursor back behind the emoji is the key.
If you move the cursor forward to after the emojii, you can type lowercase i. Back before the emoji, only uppercase. You can do this over and over again and it stays consistent. Should call this the emojIi bug.

@dchersey
Copy link
Contributor

dchersey commented Aug 21, 2018 via email

@mcmar
Copy link

mcmar commented Aug 22, 2018

I stand no chance of solving this. Objective C looks like Cyrillic lettering to me. Thus my reason for using react-native to begin with.

@Balasnest
Copy link

Balasnest commented Sep 20, 2018

Facing everywhere in textInput component. I tried adding autoCaptialize = {none} with some of the textInput. It seems to be working. All the i's letter are caps still. But this need to add everywhere.

Is there any way to fix without updating / changing react native version?

@dchersey
Copy link
Contributor

dchersey commented Sep 20, 2018 via email

@superandrew213
Copy link

@hramos I'm still experiencing this in 0.57.0.

@pribeh
Copy link

pribeh commented Sep 20, 2018

This issue should be reopened. The exact issue described is not resolved running 0.57.0. @dchersey it does seem to happen intermittently even when turning off capitalize.

@hramos
Copy link
Contributor

hramos commented Sep 20, 2018

Please do file a new issue, specific to 0.57. It's OK to refer back to this issue when doing so. Please understand that tracking comments on closed issues imparts too much additional load on maintainers, and usually opening a new issue will have better luck of getting attention from the necessary people.

@facebook facebook locked as resolved and limited conversation to collaborators Jul 24, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Component: TextInput Related to the TextInput component. Platform: iOS iOS applications. Resolution: Fixed A PR that fixes this issue has been merged. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

10 participants