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 just perform the onChange when blur #3003

Closed
augustosnk12 opened this issue Jun 21, 2022 · 2 comments
Closed

InputNumber just perform the onChange when blur #3003

augustosnk12 opened this issue Jun 21, 2022 · 2 comments
Assignees
Labels
Resolution: Workaround Issue or pull request contains a workaround. It needs to be reviewed further by Core Team Type: Bug Issue contains a defect related to a specific component. Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add

Comments

@augustosnk12
Copy link

Describe the feature you would like to see added

The current behavior of the InputNumber component has, for me, some "limitations". I would like, when I use the "onValueChange" props, to be able to listen all changes inputted, but it just happens when the input lose it's focus. The current behavior can be noticed in the following codesandbox.

https://codesandbox.io/s/wizardly-greider-ulf2li

Is your feature request related to a problem?

No response

Describe the solution you'd like

I would like the "onValueChange" to listen every change I perform in the input, not just when the input lose it's focus.

Describe alternatives you have considered

No response

Additional context

No response

@augustosnk12 augustosnk12 added the Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add label Jun 21, 2022
@cetincakiroglu cetincakiroglu self-assigned this Jul 4, 2022
@cetincakiroglu cetincakiroglu added Type: Bug Issue contains a defect related to a specific component. 👍 confirmed labels Jul 4, 2022
@amoghsingh
Copy link

Hello @augustosnk12 . Don't use the onValueChange attribute. Just use onChange in place of it. That's it.
So your input now will look like :

<InputNumber
inputId="integeronly"
value={value1}
onChange={(e) => {
setValue1(e.value);
console.log("value changed!");
}}
/>

 I had the same issue. Don't know why it doesn't trigger with onValueChange. Might be a bug from the PrimeReact. So, for now just go for onChange.

@melloware melloware added the Resolution: Workaround Issue or pull request contains a workaround. It needs to be reviewed further by Core Team label Aug 24, 2022
@augustosnk12
Copy link
Author

@amoghsingh Thanks a lot for your help!!! But right now I can even test because I'm too busy (a lot of projects are being coded 😅). When I have time I'll check this out 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Workaround Issue or pull request contains a workaround. It needs to be reviewed further by Core Team Type: Bug Issue contains a defect related to a specific component. Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

No branches or pull requests

5 participants