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 with type file not working on first attempt #2397

Closed
ghost opened this issue Feb 21, 2024 · 10 comments · Fixed by #3268
Closed

[BUG] - Input with type file not working on first attempt #2397

ghost opened this issue Feb 21, 2024 · 10 comments · Fixed by #3268
Assignees
Labels
🐛 Type: Bug Something isn't working

Comments

@ghost
Copy link

ghost commented Feb 21, 2024

NextUI Version

2.2.9 2.4.1

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

  1. Latest NextJS with App Router (fresh install)
  2. Add a to any page
  3. Select a file, you will see the value does not update and it sill says No file chosen
  4. Select a file again, now it updates and sets the file

Expected behavior

Should set the file on first attempt

Screenshots or Videos

Screen Recording 2024-02-21 at 23 46 27

Operating System Version

MacOS

Browser

Chrome

@ghost ghost added the 🐛 Type: Bug Something isn't working label Feb 21, 2024
Copy link

linear bot commented Feb 21, 2024

@ubr0n
Copy link

ubr0n commented Mar 10, 2024

Any update on this bug?

@andyryan33
Copy link

Same exact bug for me. Works fine if I just use a plain <input> but does not work using the Input component.

@m-naeem66622
Copy link

Already same issue opened here #2311

@mstfblci
Copy link
Contributor

I'm having the same problem too

@NAMANIND
Copy link

hey did anyone find the solution?

@Matiasdevv
Copy link

Matiasdevv commented Apr 9, 2024

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)
	};

@deKadir
Copy link

deKadir commented May 11, 2024

same here

@Default-01
Copy link

How about fixing this issue asap?

@wingkwong
Copy link
Member

@Default-01 The PR is being reviewed. The fix will be available in the next bug release. Please be patient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Type: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants