p-inputNumber: With suffix and minDigits > 0, negative numbers lead to an unexpected cursor jump and frozen inputs #13651
Labels
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
Describe the bug
When a p-inputNumber element has minFractionDigits>1 and suffix defined, there is a bug in concatValues() for negative values.
For example having minFractionDigits=2 and suffix=" %":
After typing -0, concatValues() produces -00 instead of 0.00 %. This is because the differentiation between an existing and no existing decimalCharacter is missing, this differentiation is only made if there is no suffix defined.
After when updating the value, after concatValues() there is another call of formatValue() in handleOnInput(). The format is then corrected to -0.00 %, but the cursor's position is put to the end of the input: "0.00 %|" instead of "0|.00 %". Further this results in the user not being able to type any more
Environment
Reproducer
No response
Angular version
16.2.1
PrimeNG version
16.3.1
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
Browser(s)
No response
Steps to reproduce the behavior
Expected behavior
No response
The text was updated successfully, but these errors were encountered: