Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InputNumber: value doesn't respect value state #6410

Open
SmitNicolas opened this issue Apr 17, 2024 · 1 comment
Open

InputNumber: value doesn't respect value state #6410

SmitNicolas opened this issue Apr 17, 2024 · 1 comment
Labels
Status: Discussion Issue or pull request needs to be discussed by Core Team

Comments

@SmitNicolas
Copy link

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

https://codesandbox.io/p/sandbox/charming-sea-99c8lj?file=%2Fsrc%2Fdemo%2FInputNumberDemo.js%3A28%2C21

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

  1. Select the input, its value should be 20 by default.
  2. Change value to 50.
  3. Click outside of the input. The value goes back to 30.

Expected behavior

  1. When trying to change the value, we shouldn't be able to write a value greater than max.
  2. The value in the input shouldn't change because its value prop is fixed.
@SmitNicolas SmitNicolas added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Apr 17, 2024
@melloware
Copy link
Member

I think this is similar to: #5091

@melloware melloware added Status: Discussion Issue or pull request needs to be discussed by Core Team and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Discussion Issue or pull request needs to be discussed by Core Team
Projects
None yet
Development

No branches or pull requests

2 participants