react-dropzone icon indicating copy to clipboard operation
react-dropzone copied to clipboard

[BUG] type on .md files return an empty string in chrome for hover events

Open Manzn opened this issue 11 months ago • 6 comments

Describe the bug Last year a bug was fixed, for uploading markdown files, where the type field was empty. Bug from last year

I am using the mantine-dropzone lib, which is using the react-dropzone. When hovering a .md file above the dropzone, the user is able to upload the file, but the UI says, that the type is not supported (because the type field for the hover event is empty like in previous bug)

I guess it is the same fix, but at a different location?!?

To Reproduce Same as in linked bug, but for the drag functions

Expected behavior When draggin a .md file above the Dropzone, type field is set correctly to text/markdown

Desktop:

  • Chrome: Version 128.0.6613.138 (Official Build) (64-bit)
  • Windows Version: Windows 10 Home - 22H2
  • OS build: 19045.4894

Additional context When using the mantine-dropzone, the reject event gets triggered when hovering a .md file above the zone, but when releasing, the upload works, since the upload bug was fixed here

Manzn avatar Feb 19 '25 10:02 Manzn

Interesting. Yes, we did fix that issue. This requires some investigation. Unfortunately, I don't have the time to do it, so if you can help get to the root cause, I would appreciate it.

rolandjitsu avatar Feb 23 '25 08:02 rolandjitsu

@rolandjitsu ok. If I find the time i will try to dig into it! Thank you.

Manzn avatar Feb 24 '25 08:02 Manzn

I have the same problem with XBRL files

corrog avatar Mar 06 '25 15:03 corrog

Facing the same problem with .bib file. @Manzn @rolandjitsu any updates on this?

jarvisphere avatar Jun 02 '25 17:06 jarvisphere

+1.

Trying to upload GPX or GeoJSON files by specifying:

{
  "application/gpx+xml": [".gpx"],
  "application/geo+json": [".geojson"],
}

Hover shows rejection. Drop works fine, accepts suitable files as expected, and rejects others. Console output verifies the accepted files have the MIME types specified above. File open dialog also works as expected, with filtering in place to only allow those specific file types.

If I also allow PNG images:

{
  "image/png": [".png"],
  "application/gpx+xml": [".gpx"],
  "application/geo+json": [".geojson"],
}

Those images are accepted correctly, but GPX and GeoJSON files still aren't, verifying that the specification itself is parsed correctly.

GPX and GeoJSON are included in COMMON_MIME_TYPES in file-selector, with the same MIME types as above.

  • tested on FIrefox 139.0.4 and Chrome 137.0.7151.120
  • Windows 11 Pro 24H2 (build 26100.4349)

stephanmantler avatar Jun 21 '25 06:06 stephanmantler

Poking around further. In fileAccepted, the file parameter appears to be bogus:

{
  kind: "file",
  type: ""
}

Not sure how to dig further than that though.

stephanmantler avatar Jun 21 '25 06:06 stephanmantler