Component: InputNumber maxlength and maxFractionDigits attributes are ignored by pasting #13588
Labels
LTS-PORTABLE
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
Describe the bug
When we set the maxlength and maxFractionDigits attributes for the inputNumber:
[maxlength]="5" [maxFractionDigits]="2"
If we type the characters, then the field will accept 5 characters which is expected. The field accepts more than 5 characters when we paste the value into the blank field (for example 1234567899)
A possible workaround could be adding the max attribute (in that case 99999) but it will still accept the 99998.9999 (as example)
Environment
Mac OS
Reproducer
https://stackblitz.com/edit/stackblitz-starters-kp6rdr?file=src%2Fmain.ts
Angular version
14.2.0 and 16.2.3
PrimeNG version
14.2.2 and 16.3.1
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
18.16.0
Browser(s)
Chrome 116.0.5845.110
Steps to reproduce the behavior
Expected behavior
Input should slice the value according to the max length and maxFractionDigits attributes after the paste or after the blur
The text was updated successfully, but these errors were encountered: