JsDaddy / ngx-mask

Angular Plugin to make masks on form fields and html elements.
https://jsdaddy.github.io/ngx-mask
MIT License
1.16k stars 300 forks source link

ngx-mask changes negative numbers to positive (including formControl value after input changes) on foreign browser locales #1171

Closed rolandarau closed 1 year ago

rolandarau commented 1 year ago

Hi ngx-mask! πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…πŸ”…

🐞 bug report

Is this a regression?

didn't find the version when this was working

Description

When using browser with some specific locales (Lithuanian, Swedish, Norwegian at least). Ngx mask displays negative number as positive and overrides it's value on change as well. To reproduce this issue change your browser's language to one of those listed above and run the stackblitz project (tested on chrome and firefox).

πŸ”¬ Minimal Reproduction

https://stackblitz.com/edit/ngx-mask-negative-numbers?file=src%2Fapp%2Fapp.component.ts

🌍 Your Environment

Angular Version: 16.0.5

Anything else relevant? this issue is present on ngx-mask@15.1.5 as well (not sure about earlier versions)

To reproduce this issue you have to change your browser language (can be found on Lithuanian, Norwegian, Swedish at least). In the screenshot below I am showing issue on my firefox in Norwegian. I didn't test all other languages, but in English it works fine. Unfortunately, we can't force customers that use our project to use English.

image
andriikamaldinov1 commented 1 year ago

@rolandarau Thanks for your using Ngx-Mask. Please update to latest version. It example, all work as expected - https://stackblitz.com/edit/angular-wpx4ku?file=src%2Fmain.ts