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

[BUG] - Input required does not clear when using controlled component #2966

Open
dennyferra opened this issue May 8, 2024 · 1 comment
Open
Assignees
Labels
📦 Scope : Components Related to the components 🐛 Type: Bug Something isn't working

Comments

@dennyferra
Copy link

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

  1. Clear the input
  2. Click off input to trigger validation
  3. Click Update button
  4. Notice email field is populated but validation still shows
  5. 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

Copy link

linear bot commented May 8, 2024

@wingkwong wingkwong self-assigned this May 9, 2024
@wingkwong wingkwong added 🐛 Type: Bug Something isn't working 📦 Scope : Components Related to the components labels May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 Scope : Components Related to the components 🐛 Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants