primeng
primeng copied to clipboard
p-inputNumber moves cursor to the far right when inserting negative values with suffix
Describe the bug
After upgrading to 15.3.0, the number input fields started moving cursor to the far right after inserting negative numbers in a field with suffix.
The issue does not appear for positive number input. The issue is present in the official PrimeNG demo website The issue was NOT present in 14.1.2
Environment
Angular 15.2 using chromium based browser (Edge or Chrome)
Reproducer
No response
Angular version
15.2
PrimeNG version
15.3.0, but applies to latest
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
16.13.2
Browser(s)
Edge, Chrome
Steps to reproduce the behavior
- Use p-inputNumber with suffix in a page (% for example)
- Navigate to the page
- Put your cursor in the input field
- Type in '-' (negative sign) followed by some number Actual result: your cursor goes at the end, after the suffix Expected result: your cursor should stay after the inserted number.
Expected behavior
Your cursor should stay after the inserted number.
The issue does not appear for positive number input. The issue is present in the official PrimeNG demo website
This issue still persists on v16.1.0, but now it happens whenever the input has a suffix, regardless of being a positive or negative number. However, on positive numbers, the cursor only shifts when a thousands separator is added (typing a number >= 1000) or removed. This is bothersome because when the cursor shifts to the far right, pressing backspace does nothing and you can't delete the number.
This behavior can be tested even in the InputNumber documentation: https://primeng.org/inputnumber#prefixsuffix
Issue still exists in v16.7.2
Issue still there in 17.12
This is a heavy bug. We have already issue tickets from our customer. Is PrimeNG not able to fix such a heavy bug within 3 major releases or after 10 months?
Issue still persists. Can you please fix this soon ?
The same thing happens with positive numbers when you write 1000 or over (though it can be circumvented by using [useGrouping]="false" )