question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When adding noClick opening the file selection programmatically does not work.

See original GitHub issue

While 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:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:7

github_iconTop GitHub Comments

4reactions
RichardDonizettecommented, Aug 5, 2019

Using the {disabled: false} object inside getInputProps solves the problem. Example: <input {… getInputProps ({disabled: false})} />

1reaction
tonciccommented, Aug 11, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found