react-native-masked-text: Problem with removing characters in the middle of the mask

v1.6.1 Having the following input

<TextInputMask
  type="custom"
  options={{ mask: '999 (99) 999 99 99' }}
/>

If I’ll type 380934295576 the mask will display correct value like 380 (93) 429 55 76 But if I remove the 2 from the middle of the mask it will display 380 (93) 49, instead of 380 (93) 495 57 6.

I’ve made some research and figured that problem is in passing value to tinymask that is already masked. in this particular case the value 380 (93) 49 55 76 is passed to the mask method and since space after 9 char doesn’t match to numeric wildcard all the following chars are getting trimmed.

Suggest passing normalized value to mask

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 18 (5 by maintainers)

Most upvoted comments

Hello, i have this problem on iOS only - cant remove separtor if cursor is not on the end of string. aa

React Native: 0.58.3 OS: iOS (12.1) react-native-masked-text: 1.12.3

TextInputMask values:

type={'custom'}
options={{
   mask: '999 999 999 999'
}}

@benhurott can you help me? 😃

+1 waiting for fix

Hello, i have this problem on iOS only - cant remove separtor if cursor is not on the end of string. aa

React Native: 0.58.3 OS: iOS (12.1) react-native-masked-text: 1.12.3

TextInputMask values:

type={'custom'}
options={{
   mask: '999 999 999 999'
}}

@benhurott can you help me? 😃

Any workaround for this issue…?

Hi, in v1.6.2 issue with the next scenario is reproduced:

fill in field “Phone number” +123 (45) 678 90. Move the cursor to number “5”, and click delete button - cursor is jump to number “2”, and deleted all numbers after “4”

😦 any updateS?

Fixed at 1.11.1 after a thousand years.

Guys, I fix some issues about these scenarios in 1.9.0.

I’m still facing a little issue with cursor but for now, some of them are fixed.

Nice,

I will reopen the issue.