iOS allows too many characters
See original GitHub issueThe following custom definition permits too many characters on iOS. Android correctly forbids the user from entering more than the specified mask. In the following example, Android restricts the text input from having more than 1 digit, but iOS does not.
<TextInputMask
type='custom'
options={{mask: '9'}}
value={this.state.inputVal}
keyboardType='numeric'
onChangeText={val => val.length <= 1 && this.setState({ inputVal: val })}
/>
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:5 (4 by maintainers)
Top Results From Across the Web
iPhone: How to enable character counter in the Messages app
iPhone: How to enable character counter in the Messages app. Fire up Settings > Messages. Scroll down until you see the SMS/MMS portion....
Read more >Limit number of characters in uitextview - ios - Stack Overflow
suppose that I have reached the limit of 140 characters so that the method will give me false and the user can not...
Read more >iOS allows too many characters · Issue #68 - GitHub
The following custom definition permits too many characters on iOS. Android correctly forbids the user from entering more than the specified ...
Read more >How to Turn on Character Count on an iPhone in 5 Steps
How to turn on character count on your iPhone. 1. Open your iPhone's Settings app. 2. Scroll and select the "Messages" tab. You...
Read more >The iPhone Text Character Limit - Small Business - Chron.com
As long as the person you're texting has an iPhone, iPad or other iOS device with an active data connection, the operating system's...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey, I’ve found a “workaround” for now: just define
maxLength
on yourTextInput
.That’s the “solution” while there isn’t an official bugfix… Example:
If you define the
credit-card
mask, just define themaxLength
of your input to19
, so it will cover the 16 digits of the credit card plus the 3 spaces. 👍Hi,
After a long investigation, I realize it can be a bug in react-native.
I tried with both TextInputMask and default TextInput. The state remains correct but it does not update current text input value O.o.
This is the code:
And take a look when we input some values into input:
Now, take a look at the
console.log
to see the state:This is absolutely bizarre and the same happen if we input values on MaskedTextInput. I will open an issue on React-Native’s repository.
Thanks for reporting.