InputNumber Component: Unable to enter numbers if minFractionDigits and maxFractionDigits are set to null
Describe the bug
When an inputNumber control is used, with the minFractionDigits and maxFractionDigits both explicitly set to null, then it is not possible to enter any number in the text box
For example, the html being used is this:
<p-inputNumber mode="decimal" [minFractionDigits]="minFractionDigits" [maxFractionDigits]="maxFractionDigits"> </p-inputNumber>
In the angular component, the relevant properties are set as follows:
public minFractionDigits?: number | null = null;
public maxFractionDigits?: number | null = null;
In this case, the textbox field does not accept numbers.
If the html is changed to remove the two properties altogether, then it works as expected. However "null" is meant to be the default value, and so you would expect it to work then the properties are set to this
Issue occurs in PrimeNg 17.13.0 but not in 17.12.0 (and all earlier versions).
Environment
Windows 10
Reproducer
https://stackblitz.com/edit/frgggh?file=src%2Fapp%2Fdemo%2Finput-number-numerals-demo.html
Angular version
17.3
PrimeNG version
17.13
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
18.19.0
Browser(s)
Edge
Steps to reproduce the behavior
Use a p-inputNumber component where the minFractionDigits and maxFractionDigits are explicitly set to null
Attempt to type in the text box
Expected behavior
Textbox accepts numbers
I'm facing the same issue
It is also worth mentioning that a javascript error appears in the console for the Stackblitz example
vendor.js:60069 ERROR RangeError: minimumFractionDigits value is out of range.
at new NumberFormat (<anonymous>)
at InputNumber.constructParser (vendor.js:154565:25)
at InputNumber.ngOnInit (vendor.js:154550:10)
This occurs when minimumFractionDigits is set to null, or undefined
This looks like it has been resolved in the latest release (although another related issue has manifested itself - https://github.com/primefaces/primeng/issues/15346)
Hi, this issue is not present in the latest version of PrimeNG (17.17.0). I'm closing the issue.
https://stackblitz.com/edit/arnqz3?file=src%2Fapp%2Finput-number-currency-demo.html The issue is still happening in the latest version
I think there was some confusion between two tickets I raised (both around input number) This particular issue has been fixed. It is another issue that is still happening - https://github.com/primefaces/primeng/issues/15346