[BUG] - Input with type file not working on first attempt
NextUI Version
2.2.9
Describe the bug
Adding an Input component with type file requires you to select the file twice before it sets it as value.
Your Example Website or App
No response
Steps to Reproduce the Bug or Issue
- Latest NextJS with App Router (fresh install)
- Add a <Input type="file" name="file" /> to any page
- Select a file, you will see the value does not update and it sill says No file chosen
- Select a file again, now it updates and sets the file
Expected behavior
Should set the file on first attempt
Screenshots or Videos
Operating System Version
MacOS
Browser
Chrome
Any update on this bug?
Same exact bug for me. Works fine if I just use a plain <input> but does not work using the Input component.
Already same issue opened here #2311
I'm having the same problem too
hey did anyone find the solution?
i just handle it like this and it worked:
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
e.preventDefault();
handleFiles(e.target.files?.[0]); //other func that recieves(file:any)
};
same here
How about fixing this issue asap?
@Default-01 The PR is being reviewed. The fix will be available in the next bug release. Please be patient.