[BUG] - Input required does not clear when using controlled component
NextUI Version
2.3.6
Describe the bug
I'm using a controlled Input component with isRequired and I have functionality to reset the form back to some previous state. If a user clears out the input field, triggers the validation by clicking away from the input (validation will show that the field is required), then clicks a button to reset the input value, the required validation continues to display even though a valid value is set in the input. Additionally, focusing the input (and un-focusing) does not cause the validation to clear either.
Example sandbox here: https://codesandbox.io/p/devbox/exciting-margulis-6y6h37
Your Example Website or App
https://codesandbox.io/p/devbox/exciting-margulis-6y6h37
Steps to Reproduce the Bug or Issue
- Clear the input
- Click off input to trigger validation
- Click Update button
- Notice email field is populated but validation still shows
- Only changing input then change focus causes validation to clear
Expected behavior
After resetting the value I would expect the validation error to clear.
Screenshots or Videos
No response
Operating System Version
Windows
Browser
Chrome
@wingkwong can i work on this one. You have assigned it to yourself that's why i am asking?
@abhisektomar1 Sure. I'm a fully occupied these days. Feel free to ping me if you have any questions. Thanks.
I don't reproduce this issue. code and dev mode are different.
the code do not controll the Input's color and the error message
@jijiseong Thanks for checking. in fact we've changed the validation behaviour in v2.4.0 so this issue should be no longer reproducible in latest version.