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

InputNumber: fix formatting of currencies with suffix #3999

Merged
merged 1 commit into from
Jun 23, 2023

Conversation

thielpa
Copy link
Contributor

@thielpa thielpa commented May 28, 2023

Currently if you enter a negative number in the InputNumber field (with formatting set to a currency with a suffix), the input becomes doubled (f.e. if you type -1, it becomes -11). This is because there is a missing check if decimalCharIndex is valid or not.

Unfortunately I did not find a solution for writing a test, that covers this bug, because this relies on the keydown event handling of input fields (which vue-test-utils does not support at the time). If you have an idea how to fix this, please let me know, I am happy to write a test for this issue.

Fix #3382

@vercel
Copy link

vercel bot commented May 28, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
primevue ⬜️ Ignored (Inspect) Jun 21, 2023 7:17pm

@thielpa thielpa changed the title fix(InputNumber): formatting of currencies with suffix InputNumber: fix formatting of currencies with suffix May 29, 2023
@Ancient-Dragon
Copy link
Contributor

@tugcekucukoglu Any updates on merging this PR this would be great to finally get fixed

@thielpa
Copy link
Contributor Author

thielpa commented Jun 21, 2023

@tugcekucukoglu pinging for visibility, because I think this PR is ready for review. If something should not be right with this PR just let me know, I am happy to make the necessary changes so my work can be merged!

Note: I think the unittest fails are not caused by my changes.

(I hope my pinging is fine, if not sorry in advance!)

@tugcekucukoglu tugcekucukoglu merged commit 1398d98 into primefaces:master Jun 23, 2023
1 of 2 checks passed
@Hulkmaster
Copy link

Hulkmaster commented Jun 26, 2023

btw shouldn't you write tests, so it would not be lost in the future?

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

Successfully merging this pull request may close these issues.

InputNumber: Incorrect formatting when in decimal mode with a suffix (maybe all the time)
4 participants