taiga-family/maskito

๐Ÿž - Ionic Input does not follow masking regex.

Closed this issue ยท 3 comments

Which package(s) are the source of the bug?

@maskito/core, @maskito/angular

Playground Link

not have one

Description

In a Capacitor 6 / ionic 8 project I used the maskito directive with this regex:

 readonly cardMask: MaskitoOptions = {
    mask: /^\d{1,4}(,\d*)?$/,
  };

The input was receiving the first 4 numbers then it would stop and shuffle the new number in.
I even tried a more elaborate regex:
/^\d{1,4}|\d{1,4},|\d{1,4}(,\d*)?$/

still the input would not let me insert a comma. The regexs work in a stackblitz, so i suppose there is a problem with field manipulation in angular.
Here is my input:

<ion-input
          type="number"
          formControlName="price"
          placeholder="Inserisci il prezzo"
          [maskito]="cardMask"
          label="Prezzo"
          labelPlacement="stacked"
></ion-input>```



### Maskito version

3.0.0

### Which browsers have you used?

- [X] Chrome
- [ ] Firefox
- [ ] Safari
- [ ] Edge

### Which operating systems have you used?

- [ ] macOS
- [ ] Windows
- [ ] Linux
- [X] iOS
- [X] Android

@filipelle Hello!

Provide reproduction (for example, github repository), please.
It's difficult to help you without it.

Also, attach video with you problem.

I've created stackblitz with you described case (angular 17 + Ionic 8 + your mask):
https://stackblitz.com/edit/maskito-ionic-angular-1434

I can't reproduce you problem in it(

Closing this issue due to the lack of reproduction.

Feel free to open a new issue again with the full reproduction of the problem.