You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thank you for this library, it is indeed quite helpful.
I am using the version V3.0.0. As the later version isn't compatible with the Angular version used by our project. However, during the recent tests, I find that ngx-currency malfunctions while users input full-width charfacters/numbers. In simplicity, you can input Chinese characters into input box with ngx-currency. Although these Chinese characters would be regarded like non-existence if you are binding the input box value to background variable using ngModel. Please see the screenshot:
There are more problems while going to mobile device. On mobile phone, we want to have number pad popped up white inputting just number, so we add
inputmode="decimal"
attribute to input box. However, if your phone is in Chinese (or Japanese, Korean), what the number pad inputs is full-width numbers (on IOS device); they cannot be handled by ngx-currency, please see screenshot
I tried modifying the source code to fix this problem. Here is the link of my commit master...JoeyWu123:ngx-currency:Full-Width-Input
With this code change, full-width numbers can be handled as same as half-width numbers (so there is no problem with mobile device now). And the full-width characters (Chinese characters) can also be rejected. However, on MS Edge and Chrome, if you input a Chinese character, the input would be rejected, meanwhile one number before the cursor would also be removed (like you press "backspace" key). There is no such problem detected on Firefox. So the fix is still imperfect.
Could you please let me know what I can do as next step? Should I submit a pull request? Or would you modify the code at your end based on my commit? If so, could you please also bring change to V3.0.0 as it's the version I needed? Thank you very much.
Oh one more thing, if you are unsure about full-width characters stuff. You may ask ChatGPT or Copilot. They can give you more straightforward information. And in Chinese, we input characters according to pronunciation (the most popular way). For example, we type "n" and then "i" to input character 你 (which means "you"). The input isn't completed if you just press single key "n" (This is called IME, input method editors). That's why handleKeyDown or handleKeyPress may not catch Chinese characters. And you may need to use handleInput.
However, I notice in currency-mask.directive.ts, the original code is
handleInput(event: any) {
if (this.isChromeAndroid()) {
!this.isReadOnly() && this.inputHandler.handleInput(event);
}
while the other code is like (please notice ! symbol in this.isChromeAndroid())
First of all, thank you for this library, it is indeed quite helpful.
I am using the version V3.0.0. As the later version isn't compatible with the Angular version used by our project. However, during the recent tests, I find that ngx-currency malfunctions while users input full-width charfacters/numbers. In simplicity, you can input Chinese characters into input box with ngx-currency. Although these Chinese characters would be regarded like non-existence if you are binding the input box value to background variable using ngModel. Please see the screenshot:
There are more problems while going to mobile device. On mobile phone, we want to have number pad popped up white inputting just number, so we add
attribute to input box. However, if your phone is in Chinese (or Japanese, Korean), what the number pad inputs is full-width numbers (on IOS device); they cannot be handled by ngx-currency, please see screenshot
I tried modifying the source code to fix this problem. Here is the link of my commit
master...JoeyWu123:ngx-currency:Full-Width-Input
With this code change, full-width numbers can be handled as same as half-width numbers (so there is no problem with mobile device now). And the full-width characters (Chinese characters) can also be rejected. However, on MS Edge and Chrome, if you input a Chinese character, the input would be rejected, meanwhile one number before the cursor would also be removed (like you press "backspace" key). There is no such problem detected on Firefox. So the fix is still imperfect.
Could you please let me know what I can do as next step? Should I submit a pull request? Or would you modify the code at your end based on my commit? If so, could you please also bring change to V3.0.0 as it's the version I needed? Thank you very much.
Oh one more thing, if you are unsure about full-width characters stuff. You may ask ChatGPT or Copilot. They can give you more straightforward information. And in Chinese, we input characters according to pronunciation (the most popular way). For example, we type "n" and then "i" to input character 你 (which means "you"). The input isn't completed if you just press single key "n" (This is called IME, input method editors). That's why handleKeyDown or handleKeyPress may not catch Chinese characters. And you may need to use handleInput.
However, I notice in currency-mask.directive.ts, the original code is
while the other code is like (please notice ! symbol in this.isChromeAndroid())
so I am curious why it's not
Is this a bug? What's the purpose to add "!this.isChromeAndroid()" condition? Actually after I change it to
The input box can reject Chinese characters
The text was updated successfully, but these errors were encountered: