ngx-mask
ngx-mask copied to clipboard
Input bug only in an Android device - ex: 1.000,00 is transformed to 10.001.000
🐞 bug report
Description
A strange thing is happening when I input the value 1000 in a input, this happens only with this exact value, other values are inputted correctly, this happens only in an Android device, on PC work's fine.I am using Angular material and when I test simulating the Pixel 2 work's fine, only in the mobile this occur.
Input Examples:
1000 ==> 10.001.000 (Incorrect) 2000 ==> 2.000 (Correct) 1234.35 ==> 1.234,35 (Correct)
I am using the version 11.1.4 because the new version doesn't work well with the latest Angular 11, Reactive forms with null values are crashing on console log, then I reverted the ngx-mask update.
🔬 Minimal Reproduction
https://stackblitz.com/edit/angular-ivy-mask-nfvri8🌍 Your Environment
Angular Version:
Angular CLI: 11.2.11
Node: 16.0.0
OS: linux x64
Angular: 11.2.12
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1102.11
@angular-devkit/build-angular 0.1102.11
@angular-devkit/core 11.2.11
@angular-devkit/schematics 11.2.11
@angular/cdk 11.2.11
@angular/cli 11.2.11
@angular/flex-layout 11.0.0-beta.33
@angular/material 11.2.11
@schematics/angular 11.2.11
@schematics/update 0.1102.11
rxjs 6.5.5
typescript 4.1.5
Anything else relevant? The problem is specific on Android devices.
I am using Ngx-Mask 11.1.4 due a problem with reactive forms when the value is null in the newer version, is reported this error on console.log:
this._maskService.removeMask(...) is null
This issue happens also on other masks, like for IBAN (XXXX-XXXX-XXXX-XXXX), where it duplicates DE07- to DE07-DE07. As soon as ngx-maxk interacts, we have seen a duplicate input. Wasn't able to identify the root case so far, it somehow duplicates the keyup.
This renders this plugin unusable for mobile in general, as I do not want to exclude google pixel (eg android 11, Pixel 5) specifically. I would consider this as a critcal bug.
This bug would also like to consider it critical, in fields with financial values, quantity and others, if you don't pay attention to the value entered, it can generate big problems, the funny thing is that this only occurs on android devices.
If you need only currencies, you might want to use ngx-currency instead, which works flawless as far as we have tested.
@Mirai-sp @maxmarkus Thanks for your using Ngx-Mask. Please update to latest version. We check it on android devices all work as expected- https://stackblitz.com/edit/angular-gte92l?file=src%2Fmain.ts