primefaces / primefaces/primereact
InputNumber: value doesn't respect value state
Nobody has claimed this yet.
- Dominant language
- CSS
- Stars
- 8.3k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
It seems that the value prop provided to <InputNumber/> isn't always correctly used.
The user can also think he's writing a value greater than the max value, because it's checked on blur.
The value can be outdated even after component blur.
Reproducer
PrimeReact version
9.3.1
React version
17.x
Language
TypeScript
Build / Runtime
Create React App (CRA)
Browser(s)
No response
Steps to reproduce the behavior
- Select the input, its value should be 20 by default.
- Change value to 50.
- Click outside of the input. The value goes back to 30.
Expected behavior
- When trying to change the value, we shouldn't be able to write a value greater than
max. - The value in the input shouldn't change because its
valueprop is fixed.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the InputNumber component and run the linked CodeSandbox reproducer. Verify the controlled value, max handling, and blur behavior described in the reproduction steps; the issue is done when values above max cannot be entered and a fixed value prop is not overwritten after blur.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100