When adding noClick opening the file selection programmatically does not work.
See original GitHub issueWhile updating a component to use the latest version (10.1.7) of DropZone I came accross the following bug.
When adding noClick it is not longer possible to open the file selection programmatically.
The reason is that the version tested adds a disabled=""
to the input field via getInputProps
This behavior can be tested with the examples at https://react-dropzone.js.org/#opening-file-dialog-programmatically
Renaming the disabled attribute (via the Inspector) of the hidden file input field on that page, will make the button click work again.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:7
Top Results From Across the Web
In JavaScript can I make a "click" event fire programmatically ...
The solution is complex yet simple. The first step is to make use of CSS and guise the input file type with "under-elements"...
Read more >How to programmatically fire a click event for a file input ...
In this article, we will learn how to programmatically fire click events on the input file element. Approach: Whenever you want to perform...
Read more >react-dropzone
Simple React hook to create a HTML5-compliant drag'n'drop zone for files. Documentation and examples at https://react-dropzone.js.org.
Read more >Using files from web applications - Web APIs - MDN Web Docs
To allow opening the file picker without using JavaScript (the click() method), a <label> element can be used. Note that in this case...
Read more >Buttons - Android Developers
Using an OnClickListener ... You can also declare the click event handler programmatically rather than in an XML layout. This might be necessary ......
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
Using the {disabled: false} object inside getInputProps solves the problem. Example: <input {… getInputProps ({disabled: false})} />
Is there any reason to be disabled by default? I think all of us are expecting NOT to be disabled by default.