flowbite icon indicating copy to clipboard operation
flowbite copied to clipboard

File Input - dropzone not working

Open Loots-it opened this issue 2 years ago • 9 comments

Describe the bug I cannot properly use the dropzone functionality on this page:

https://flowbite.com/docs/forms/file-input/#dropzone

I can select a file by clicking on the dropzone, but I cannot select a file by 'dropping' a file into the dropzone. This also doesn't work when I try it locally on my dev environment.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://flowbite.com/docs/forms/file-input/#dropzone
  2. Try to drag a file into the dropzone
  3. Nothing happens (or the image gets opened in a new window)

Expected behavior It should be possible to drop a file in the dropzone.

Desktop (please complete the following information):

  • OS: Mac 12.6
  • Browser: both Chrome (109.0.5414.119) and Safari (15.6.1)

Loots-it avatar Feb 15 '23 18:02 Loots-it

I just tested this on a Windows pc in Chrome and I got the same issue.

Loots-it avatar Feb 15 '23 18:02 Loots-it

The Code is functional, if you tweak the class on Line 9 as shown below the uploaded file can been seen. class="hidden >> class="unhidden"

Tydewest avatar Feb 19 '23 08:02 Tydewest

It's still not working, if I show the normal file input field like you suggest I can drop the file in there. But the whole idea is that the button is hidden and that I can drop the file anywhere in the 'dropzone'.

Loots-it avatar Feb 19 '23 19:02 Loots-it

You'll most likely need to modify it to fit your needs, What framework are you using?

Tydewest avatar Feb 21 '23 11:02 Tydewest

I'm using Laravel, but it seems like the whole Laravel installation guide isn't working properly. I just tried to install it into a new Laravel project using this guide: https://flowbite.com/docs/getting-started/laravel/

Nothing seems to work...

Loots-it avatar Feb 25 '23 14:02 Loots-it

@Loots-it you can get it to work by

  • add relative class to the label and input wrapper
  • removing hidden class from input
  • add the following tailwind classes instead to the input- absolute top-0 left-0 w-full h-full opacity-0 cursor-pointer

highlydeveloped avatar Mar 08 '23 14:03 highlydeveloped

I'm sorry for the late reply. Thanks for your help, that seems to do the trick! I assume the example should be updated, but it seems like there are already many open merge requests...

Loots-it avatar Apr 13 '23 14:04 Loots-it

@highlydeveloped Thanks it worked

SkylerB1 avatar Jun 05 '23 12:06 SkylerB1

Is there a way to show ProgressBar with it as well ? Can't seem to find that in docs ?

HassanAkbar avatar Apr 06 '24 11:04 HassanAkbar