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] - NextUI Input Field Value Disappears on Mouse Hover When Using React Hook Form #3678

Closed
iGmainC opened this issue Aug 23, 2024 · 11 comments · Fixed by #3533
Closed

[BUG] - NextUI Input Field Value Disappears on Mouse Hover When Using React Hook Form #3678

iGmainC opened this issue Aug 23, 2024 · 11 comments · Fixed by #3533
Labels
📦 Scope : Components Related to the components 🐛 Type: Bug Something isn't working

Comments

@iGmainC
Copy link

iGmainC commented Aug 23, 2024

NextUI Version

2.4.6

Describe the bug

When using NextUI's Input component with React Hook Form, the input field value disappears upon mouse hover after setting the value programmatically with setValue.

Your Example Website or App

https://github.com/iGmainC/nextui-bug

Steps to Reproduce the Bug or Issue

Create a React component using Next.js, NextUI, and React Hook Form.
Set up a simple form with two input fields: name and password.
Add a button that, when clicked, sets the name field value to "root" using React Hook Form's setValue method.
Hover over the input field after clicking the button.

Expected behavior

The input field should retain the value "root" when hovering over it.

Screenshots or Videos

QQ2024823-1528.mp4

Operating System Version

linux

Browser

Chrome

@iGmainC
Copy link
Author

iGmainC commented Sep 5, 2024

@wingkwong The Select component has a similar problem.

@wingkwong
Copy link
Member

Reopening this issue. The linked PR has been rollbacked.

@wingkwong wingkwong reopened this Sep 6, 2024
@iGmainC
Copy link
Author

iGmainC commented Sep 6, 2024

@wingkwong

20240906-104151.mp4

My code repository nextui-bug has been updated.

I now suspect that Radio and Checkbox components also have similar problems.

@wingkwong
Copy link
Member

may need to check all input based components once

@jprosevear
Copy link

I believe this is also an issue when using useForm({values}) which can be delayed and then synced to the inputs later (on promise resolution with API for instance).

@MikhailMarczal
Copy link

same issue here, nextui version 2.4.8
I'm using Controller as a workaround

@parteekmalik
Copy link

@MikhailMarczal can you explain how to use controller

@jprosevear
Copy link

@parteekmalik https://react-hook-form.com/docs/usecontroller

@milos201
Copy link

I noticed it says "Fixed by #3533". This is not fixed.

@wingkwong
Copy link
Member

let's track in #3436 from now on.

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

Successfully merging a pull request may close this issue.

6 participants