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

TextInput : Unable to prevent chars to be added on iOS. #19252

Closed
yairopro opened this issue May 14, 2018 · 5 comments
Closed

TextInput : Unable to prevent chars to be added on iOS. #19252

yairopro opened this issue May 14, 2018 · 5 comments
Labels
Component: TextInput Related to the TextInput component. Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.

Comments

@yairopro
Copy link

It's impossible on iOS to prevent some new chars to be typed.
Here's a snack where only numbers are accepted in the input. It works perfectly on android. No on iOS.

Environment

OS: macOS High Sierra 10.13.4
Node: 9.11.1
Yarn: 1.6.0
npm: 6.0.0
Watchman: Not Found
Xcode: Not Found
Android Studio: 3.1 AI-173.4720617

Steps to Reproduce

  1. Taking the text from onChangeText callback
  2. Removing the new typed char if it's not accepted.
  3. Updating the TextInput's value using the setState method.

Expected Behavior

Removing the char as soon as it's been typed. Works on Android.

Actual Behavior

The non accepted char stays in the TextInput even though the component re-rendered assigning the corrected value to the TextInput.

@react-native-bot
Copy link
Collaborator

Thanks for posting this! It looks like your issue may be missing some necessary information. Can you run react-native info and edit your issue to include these results under the Environment section?

Thank you for your contributions.

@react-native-bot react-native-bot added ❔Needs More Information Platform: iOS iOS applications. Component: TextInput Related to the TextInput component. labels May 14, 2018
@yairopro
Copy link
Author

It's already included.

@francisli
Copy link

Maybe a duplicate of #18874 ...?

@yairopro
Copy link
Author

@francisli That's right. Sorry.
Should I close?

@react-native-bot
Copy link
Collaborator

Duplicate of #18874

@react-native-bot react-native-bot marked this as a duplicate of #18874 May 15, 2018
@facebook facebook locked as resolved and limited conversation to collaborators May 15, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label May 15, 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: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

3 participants