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

issues with controlled TextInput with text replacement, "." shortcut on iOS #27693

Closed
chrisdrackett opened this issue Jan 6, 2020 · 27 comments
Closed
Labels
Bug Never gets stale Prevent those issues and PRs from getting stale Platform: iOS iOS applications. Resolution: Fixed A PR that fixes this issue has been merged.

Comments

@chrisdrackett
Copy link

chrisdrackett commented Jan 6, 2020

React Native version: 0.61.4

Steps To Reproduce

  1. Create a TextInput component:
        <TextInput
          onChangeText={setValue}
          value={value}
        />
  1. In iOS settings > general > keyboard make sure that "." Shortcut is on.
  2. make sure "Check Spelling" is on.
  3. make sure at least one thing is available in "Text Replacement" (omw should be there by default)
  4. within the text input you created type some misspelled text.
  5. press space twice after your text
  6. type the text replacement shortcut

Describe what you expected to happen:

  1. Miss-spelled text should have a red underline
  2. there should be a period when space is pressed twice
  3. text replacement shortcut should be replaced with its matching text.

The above will not be true when using value on a TextInput. If you remove the value prop and have the component uncontrolled the above all works as expected. Also, if the component is made multiline the above all work as expected, even in the controlled case.

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

https://snack.expo.io/H18J_rWlI

@react-native-bot react-native-bot added the Platform: iOS iOS applications. label Jan 6, 2020
@chrisdrackett chrisdrackett changed the title issues with controlled text input with text replacement, "." shortcut on iOS issues with controlled TextInput with text replacement, "." shortcut on iOS Jan 14, 2020
@RobPando
Copy link

RobPando commented Feb 6, 2020

I am running into the same issue. it works when the shortcut is a-z like if you make a text replacement "smh" -> shake my head it works but if it is any special character such as a text replacement "@@" -> [email protected] it does not work UNLESS you enable multiline

@stale
Copy link

stale bot commented May 6, 2020

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.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label May 6, 2020
@chrisdrackett
Copy link
Author

this issue has not been fixed, not sure how to get it more attention

@stale stale bot removed the Stale There has been a lack of activity on this issue and it may be closed soon. label May 6, 2020
@ozer
Copy link

ozer commented Jun 11, 2020

+1

@thomas-negrault
Copy link

I see I'am not the only one with the @@ shortcut for my email. Setting the multiline option solved the issue but introduce a new one for me: If I hit the return key (which in my case is returnKeyType="next") it add a new \n to my input value. So it's not really solved.

@chrisdrackett
Copy link
Author

does this issue need a needs triage label? /cc @cpojer

@husenLogicwind
Copy link

I am also running into the same issue.
"react": "16.9.0",
"react-native": "0.61.3",

@sonnd08
Copy link

sonnd08 commented Sep 22, 2020

The same with me, any update on this?
"react": "16.11.0",
"react-native": "0.62.2",

@maronk
Copy link

maronk commented Sep 22, 2020

Same problem here - exact same versions as @sonnd08
"react": "16.11.0",
"react-native": "0.62.2",

@mhoran
Copy link
Contributor

mhoran commented Oct 3, 2020

Related to #22078 and possibly #29572. I found that my fix for #29572 works around this issue, but it's not great and doesn't work for everyone.

@brightsider
Copy link

Any news?

@trackwell-mike
Copy link

trackwell-mike commented Dec 13, 2021

This is one of the telltale signs someone has built their app in React Native, that iOS Text Replacement doesn't work.

Any update?

@seba-montagna-rocketlab
Copy link

seba-montagna-rocketlab commented Oct 6, 2022

Any news on this issue? Still randomly happens in TextInputs that are not multiline.
https://snack.expo.dev/kdvZ6ciy8

@github-actions
Copy link

github-actions bot commented Apr 4, 2023

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.

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Apr 4, 2023
@github-actions
Copy link

This issue was closed because it has been stalled for 7 days with no activity.

@chrisdrackett
Copy link
Author

guess thats what I get for going on vacation :\

@cortinico cortinico reopened this Apr 11, 2023
@cortinico cortinico removed the Stale There has been a lack of activity on this issue and it may be closed soon. label Apr 11, 2023
@hasebsiddiqui
Copy link

ANy update ?

@gedu
Copy link

gedu commented May 19, 2023

@chrisdrackett @mhoran Hey, I'm looking at it and I think I found a possible solution: Here is where I posted everything: #37437

@nicotroia
Copy link

nicotroia commented Jul 30, 2023

I'm still getting this issue on "react-native": "0.70.8". Text replacement on iOS doesn't work unless multiline is enabled on the TextInput

@ZONTeek
Copy link

ZONTeek commented Aug 25, 2023

still an issue "react-native": "0.71.3"

@gedu
Copy link

gedu commented Sep 8, 2023

I'm looking at it again, My Mac broke and took a while to fix it

@gedu
Copy link

gedu commented Sep 11, 2023

PR created: #39385

@NickGerleman
Copy link
Contributor

Likely fixed in new arch with #46970 (thanks @gedu for linking me to this!)

@mhoran
Copy link
Contributor

mhoran commented Oct 27, 2024

@NickGerleman I tried applying your patch to an Expo v52 (React Native 0.76.0) project using New Arch. Unfortunately it doesn't seem to resolve this issue and the workaround I referenced earlier no longer works in 0.76.0 and New Arch.

Perhaps I did something wrong, but I'm fairly certain the patch is applying and it doesn't seem to change the behavior.

@cortinico would you please reopen this issue?

@gedu
Copy link

gedu commented Oct 28, 2024

I can give a second look (?)

@mhoran
Copy link
Contributor

mhoran commented Oct 28, 2024

Here is a reproducer with the patch applied: https://github.com/mhoran/new-arch-autocorrect-repro. I also opened a pick request (reactwg/react-native-releases#595) though it's a bit moot since the bug does not seem to be fixed.

@mhoran
Copy link
Contributor

mhoran commented Oct 29, 2024

This should be fixed in main by #47269 and #46970. I've filed a pick request for 0.76. For those who want to test sooner, you can apply the patches to 0.76.0 via patch-package as shown in the reproducer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Never gets stale Prevent those issues and PRs from getting stale Platform: iOS iOS applications. Resolution: Fixed A PR that fixes this issue has been merged.
Projects
None yet
Development

No branches or pull requests