uNmAnNeR / imaskjs

vanilla javascript input mask
https://imask.js.org
MIT License
4.92k stars 256 forks source link

Different masking behaviour on Android #836

Open andregoncalvesdev opened 1 year ago

andregoncalvesdev commented 1 year ago

Describe the bug

I am having different masking behaviour on android/chrome. Simply typing 100 and then 1.

Tested on different devices and environments and it happens only on this specific version of chrome. Also, if we set the inputMode as numeric it doesn't happen.

Desktop

https://user-images.githubusercontent.com/9271177/226673372-a28da2bb-fc2e-4cca-a6cd-d44ebdc6cb31.mp4


Mobile

https://user-images.githubusercontent.com/9271177/226673894-e830a831-2845-4a71-8dab-c35956d83460.mp4


To Reproduce

https://codesandbox.io/s/quirky-goldstine-py3ths

Expected behavior

1001 -> 1,001 on both.

Environment:

ArmanNisch commented 1 year ago

I can confirm I am also seeing this behaviour. It's actually any number that one types after 100 with x.

So type 100, wait two seconds, type 1, then one gets 10,011,001 Type 100, wait two seconds, type 2, then one gets 10,021,002 Type 100, wait two seconds, type 3, then one gets 10,031,003 Type 100, wait two seconds, type 4, then one gets 10,041,004 Type 100, wait two seconds, type 5, then one gets 10,051,005

This issue also only seems to happen on the 100 number. I tried 200 x, 300 x, 400 x, etc. and all seemed fine.

pangolingo commented 1 year ago

I've also observed this issue. We worked around it by using inputmode="numeric", which does seem to resolve the problem.

I noticed that typing 100 and then non-numbers (q, m, etc) will also add extra digits to the input.

Environment:

Device: Pixel 5a OS: Android OS version: 13 Browser: chrome Chrome Version: 112.0.5615.135 react-imask version: ^6.4.3

ArmanNisch commented 1 year ago

Any update on this? :)