[BUG] File dialog enables only the first file type from accept, others are disabled
See original GitHub issueDescribe the bug
When defining the accept
object like
useDropzone({
accept: {
'image/jpeg': [],
'image/png': [],
}
})
the file drop option works properly. In case the user wants to pick a file from file dialog, only the first file type from accept
is enabled, the rest are disabled and greyed out.
To Reproduce Steps to reproduce the behavior:
- Go to “Accepting specific file types”: Click me
- Click on the dropzone field
- File dialog opens up
- User can select a
.jpeg
file, but not a.png
file
Expected behavior
All defined file types in the accept
object should be enabled for selection via file dialog
Desktop:
- OS: macOS Monterey (Version 12.3.1)
- Browser: Chrome (Version 101.0.4951.54 (Official Build) (x86_64))
- React DropZone: 14.2.0
Issue Analytics
- State:
- Created a year ago
- Comments:6
Top Results From Across the Web
1054966 - Policy page opens a file dialogue even if the Allow ...
1. Start the Chromium browser with the "AllowFileSelectionDialogue" policy disabled. 2. Open the internal policy page (chrome://policy). 3. Press the "Export to ...
Read more >OpenFileDialog Class (System.Windows.Forms)
Gets or sets a value indicating whether the OK button of the dialog box is disabled until the user navigates the view or...
Read more >How to remove All Files option from file input dialog?
It will allow all image types, and in case of mobile devices ... <input type="file" accept="image/*"> //This will match all image files.
Read more >How to Use File Choosers - Oracle Help Center
Another way to present a file chooser is to add an instance of JFileChooser to a ... Bringing up a standard open dialog...
Read more ><input type="file"> - HTML: HyperText Markup Language | MDN
The accept attribute value is a string that defines the file types the file input should accept. This string is a comma-separated list...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@shomyx - I had the same issue/confusion. It wasn’t obvious to me that only one file type was selected, because MacOS Catalina doesn’t show the “Options” select box by default. I read the discussion / tickets that @rolandjitsu provided on the File System Access API, and opted to disable that feature by adding
useFsAccessApi: false
to the useDropzone configuration.This, to me, works as expected. The one drawback, is that it combines all of the accepted file types into a single “Custom Files” entry in the “Options” select box. You may want to vote on having the File System Access API disabled by default: https://github.com/react-dropzone/react-dropzone/discussions/1186
@shomyx that’s expected behaviour when using the File System Access API. If you check the screencast I’ve attached, you’ll see that you need to select the option to select other mime types based on the
accept
attr.https://user-images.githubusercontent.com/1479737/167239126-15ef8900-ecad-4b13-9605-e2a217b72b7a.mp4