You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the InputOtp component, the value in the onValueChange callback is returned incorrectly.
Actual Behavior
The changes made are not applied immediatly, only at the next change.
Additional information
This is due to the operation of the useState hook.
The set function only updates the state variable for the next render. If you read the state variable after calling the set function, you will still get the old value that was on the screen before your call.
Describe the bug
Description
When using the InputOtp component, the value in the onValueChange callback is returned incorrectly.
Actual Behavior
The changes made are not applied immediatly, only at the next change.

Additional information
This is due to the operation of the useState hook.
Reproducer
No response
System Information
Steps to reproduce the behavior
Expected behavior
the value changes immediately