primereact icon indicating copy to clipboard operation
primereact copied to clipboard

InputNumber: Isssue with suffix in decimal type number field

Open vishalgupta3006 opened this issue 3 years ago • 2 comments

Describe the bug

In a InputNumber field having decimal values and suffix, when user try to enter decimal point(.) then suffix is shown 2 times. User is not able to add digits after the decimal place as when digits are entered, then all the value get lost.

Reproducer

https://codesandbox.io/s/primereact-test-forked-s6vo96

PrimeReact version

8.0.1

React version

18.x

Language

ES6

Build / Runtime

Create React App (CRA)

Browser(s)

No response

Steps to reproduce the behavior

<InputNumber suffix="Kms" min={0} max={999} onValueChange={onChange} mode="decimal" maxFractionDigits={4} />

Expected behavior

No response

vishalgupta3006 avatar May 11 '22 11:05 vishalgupta3006

Steps to reproduce

  • The maxFractionDigits property of the InputNumber element needs to be > 1
  • The minFractionDigits property needs to be either absent from the InputNumber element or it needs to be set to zero
  • In the input field, type in any numerical characters followed by a period. The suffix will duplicate.

Updated Codesandbox: https://codesandbox.io/s/primereact-test-forked-s6vo96

jacob-w-gable avatar Jun 03 '22 15:06 jacob-w-gable

Confirmed.

melloware avatar Jun 03 '22 16:06 melloware

@melloware, when the input number enters a value, this fix breaks the InputNumber with currency format. So, reverted.

mertsincan avatar Dec 01 '22 11:12 mertsincan

PrimeVue: https://github.com/primefaces/primevue/issues/3382

melloware avatar Dec 12 '22 17:12 melloware

This issue has been automatically marked as stale. If this issue is still affecting you with the latest version, please leave any comment, and we will keep it open. We are sorry that we have not been able to prioritize it yet. If you have any new additional information, please include it with your comment!

github-actions[bot] avatar Dec 08 '23 01:12 github-actions[bot]

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you for your understanding!

github-actions[bot] avatar Dec 15 '23 01:12 github-actions[bot]