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

Updating minFractionDigits and maxFractionDigits results in error #9466

Closed
AndreiVajnaII opened this issue Oct 29, 2020 · 1 comment
Closed
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@AndreiVajnaII
Copy link

I'm submitting a ... (check one with "x")

[X] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Current behavior
When both minFractionDigits and maxFractionDigits are changed for an InputNumber, it results in an error:

Error: maximumFractionDigits value is out of range.

Expected behavior
No error should occur and the InputNumber should be formatted using the new settings.

Minimal reproduction of the problem with instructions
Use a InputNumber with format set to true and both minFractionDigits and maxFractionDigtis set to 1.
Update both faction digits to 2, for example on a button click.

See the demo: https://stackblitz.com/edit/github-gchfwb?devtoolsheight=33&file=src/app/app.component.ts

Just click on the "Change" button and see the console.

Please tell us about your environment:

  • Angular version: 10.0.14
  • PrimeNG version: 10.0.3
@yigitfindikli yigitfindikli added the Status: Pending Review Issue or pull request is being reviewed by Core Team label Nov 25, 2020
@yigitfindikli yigitfindikli self-assigned this Nov 25, 2020
@drml
Copy link

drml commented Mar 8, 2021

+1
The problem seems to be that the setter of minFractionDigits calls this.updateConstructParser() right away, i.e. with the "old" maxFractionDigtis value still in place: https://github.com/primefaces/primeng/blob/master/src/app/components/inputnumber/inputnumber.ts#L229
(guessing ... detect using OnChanges instead of setters ?)

@mertsincan mertsincan added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Pending Review Issue or pull request is being reviewed by Core Team labels Sep 6, 2021
@mertsincan mertsincan added this to the 12.1.1 milestone Sep 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

4 participants