primefaces / primeng

The Most Complete Angular UI Component Library
https://primeng.org
Other
10.43k stars 4.6k forks source link

InputNumber suffix block entering fraction digits in field #14769

Open bartez opened 8 months ago

bartez commented 8 months ago

Describe the bug

When I provide suffix for input number with mode=decimal then I cannot provide fraction digits. After enter dot and provide fraction digit the field will cleared.

<p-inputNumber suffix="Mg" mode="decimal" [maxFractionDigits]="5">

But when I set minFractionDigits more than 0 then problem is gone.

<p-inputNumber suffix="Mg" mode="decimal" [minFractionDigits]="2" [maxFractionDigits]="5">

Environment

Error repeated regardless of environment settings. Also repeats on sample code in documentation

Reproducer

https://stackblitz.com/edit/gv83do?file=src%2Fapp%2Fdemo%2Finput-number-numerals-demo.html

Angular version

17.0.9

PrimeNG version

17.6.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

20.10.0

Browser(s)

Chrome 121

Steps to reproduce the behavior

  1. Try enter value with fraction digits eg. 1.234 in field is
  2. After enter dot and number will clear form value.

The sample video describing steps: https://github.com/primefaces/primeng/assets/1591522/8fa99b46-ca8d-4a09-af2d-14550c9b1737

Expected behavior

Values after the decimal point should be able to be entered.

erber014 commented 8 months ago

Hi, I can confirm I have the same issue. There is an issue when mode="currency" also as the currency mode uses prefixes/suffixes https://github.com/primefaces/primeng/issues/14227

ldesgrange commented 4 months ago

This seems to be a recurrent breakage:

KevinHetzelGFL commented 4 months ago

Same issue in 17.18.2

tarockx commented 2 months ago

Using v17.18.9 and I can confirm the issue is still present: if minFractionDigits is set to 0 and you use a suffix typing the number correctly is almost impossible, the cursor starts jumping around or not responding at all.