Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chrome on Android devices let me not input more than 1 number in mode NATURAL #100

Closed
Maverickcg opened this issue Jun 23, 2020 · 5 comments

Comments

@Maverickcg
Copy link

Hello

We use your directive in our project and we like it and did not experience problems until now. But yesterday we did a user test and the user had an Android device running chrome. He told us that he was not able to insert any currency values other than the ones with just one number. In Our case for example:

Input: 1 --> Output: 1,00 €

All other inputs are not accepted. I investigated this issue and found a reason.

If running AndroidChrome the directive does not do handleKeypress() but instead handleInput(). This sets the cursor to the end of the input fields text after the first number input or before all subsequent inputs.
If the user has input the above number and now inputs 2 the resulting rawValue looks like 1,00 €2. This gets converted to 1002 and then truncated to 100 in inputService and the final result is again 1,00 €.
On all devices other than Android with Chrome the handleInput() method is not used and the cursors position is not set to the end what leads to the expected output. Is this the intended behaviour or did I miss something here?

Best regards

@PavelShell
Copy link

I'm facing this issue too.

@PavelShell
Copy link

PavelShell commented Jul 9, 2020

Okay, i've fixed it. PR will be soon.

@PavelShell
Copy link

Hello

We use your directive in our project and we like it and did not experience problems until now. But yesterday we did a user test and the user had an Android device running chrome. He told us that he was not able to insert any currency values other than the ones with just one number. In Our case for example:

Input: 1 --> Output: 1,00 €

All other inputs are not accepted. I investigated this issue and found a reason.

If running AndroidChrome the directive does not do handleKeypress() but instead handleInput(). This sets the cursor to the end of the input fields text after the first number input or before all subsequent inputs.
If the user has input the above number and now inputs 2 the resulting rawValue looks like 1,00 €2. This gets converted to 1002 and then truncated to 100 in inputService and the final result is again 1,00 €.
On all devices other than Android with Chrome the handleInput() method is not used and the cursors position is not set to the end what leads to the expected output. Is this the intended behaviour or did I miss something here?

Best regards

#103

@jlabanca
Copy link
Contributor

This is a duplicate of Issue #90

@nbfontana
Copy link
Owner

Fixed at ngx-currency@2.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants