[BUG] Clicking the dropzone area won't open the choose file dialog on newest Chrome
See original GitHub issueHello and thanks for the great hook. I came across this bug this morning and thought that it should be reported.
Describe the bug When clicking the dropzone, the dialog for choosing files does not appear. This might be due to browser update. Yesterday the click to open dialog was working as expected.
To Reproduce
const { getRootProps, getInputProps } = useDropzone({
validator: duplicateFileValidator,
onDrop: (files: File[]) => {
const uniques = Array.from(new Set(filesArray))
setFilesArray([...uniques, ...files])
},
accept: acceptedFileTypes,
maxSize: maxSizeBytes,
})
<div className={styles.dropZone} {...getRootProps()} id="upload-file">
<input {...getInputProps()}/>
</div>
Expected behavior A dialog for choosing a file should open. Works as expected in Firefox.
Desktop (please complete the following information):
- OS: macOS 12.5.1
- Chrome 105.0.5195.102 (Official Build) (arm64)
- React-dropzone version:
11.4.2
I tried it also on the latest 14.2.2
, but same bug there.
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:7
Top Results From Across the Web
HTML Form file chooser not opening on Chrome
I'm facing a problem that in Chrome the file upload chooser not showing up, but in Firefox and Safari it's opened and working...
Read more >Drag and Drop file on Open / Save Dialog boxes to navigate to ...
Just upgraded an old mac from High Sierra to Monterey (Thanks to OCLP) and I noticed that when I drag and drop a...
Read more >Examples - react-dropzone
getRootProps({className: 'dropzone'})}> <input {...getInputProps()} /> <p>Drag 'n' drop some files here, or click to select files</p> </div> <aside> ...
Read more >Drop zone - Shopify Polaris
The drop zone component lets users upload files by dragging and dropping the files into an area on a page, or activating a...
Read more >FileDrop.js - self-contained cross-browser HTML5, legacy ...
Fixed visual bugs when <fieldset> was used as a drop zone in Firefox 13 and up. ... clicks the drop zone and selects...
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
Can confirm was having the same issue in Chrome
105.0.5195.125
upgrading to version 14.2.3 and updating chrome to latest106.0.5249.119
fixed itI can confirm I am seeing the same behavior, using
14.2.2
. It works on Firefox104.0.2
and Gnome Web Browser42.4
, but not in Chrome105.0.5195.125
.Some more details:
In
openFileDialog
callback function,window.showOpenFilePicker
throws:When it tries to fall back to the
inputRef
click function, it fails, but it logs a warning in the console:Weirdly, some times
window.showOpenFilePicker
throws: