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.

Accept filter no work

See original GitHub issue

Do you want to request a feature or report a bug?

  • [ x] I found a bug
  • I want to propose a feature

What is the current behavior?

I’m trying to set that only certain file types need to be selected, a filter. I’ve tried something like this but it doesn’t seem to work.

<Dropzone onDrop={this.onDrop} multiple={false} accept=".jpg,.jpeg"/>

What is the expected behavior?

Select only the files that have that type of extension.

Please mention other relevant information such as the browser version, Operating System and react-dropzone version.

Google chrome: latest version
react-dropzone: "^10.1.6"
Linux ubuntu

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
Angelk90commented, Aug 1, 2019

@rxmarbles : seems not to work.

When I go to select the files, it also shows me those that have a different extension than the one I inserted in the accept, and also makes them select me.

Also on the example page: https://codesandbox.io/s/vvw87k06k5 Makes me select files that are not images.


function Dropzone(props) {
  const { acceptedFiles, getRootProps, getInputProps } = useDropzone({
    onDrop: props.onDrop,
  });
  const file = acceptedFiles[0];
  return (
    <div>
      <div {...getRootProps({ className: 'drop-zone' })}>
        <input {...getInputProps()} multiple={false} />
        <p>
          Trascina qui la fotocopia della carta d'identità e fai clic per
          selezionare i file:
          {file && (
            <span>
              {file.path} - {file.size} bytes
            </span>
          )}
        </p>
      </div>
    </div>
  );
}

...

<Dropzone
                  onDrop={this.onDrop}
                  multiple={false}
                  accept="image/jpg, image/jpeg"
                />
0reactions
rxmarblescommented, Aug 2, 2019

@Angelk90 If you use the examples from http://react-dropzone.js.org/ do they work for you?

Read more comments on GitHub >

github_iconTop Results From Across the Web

5 Reasons why your Excel filter may not be working
5 Reasons why your Excel filter may not be working · 1. Check that you have selected all of the data · 2....
Read more >
[9 Fixes] For Filter Not Working In Excel Problem
From the “data” tab select the “Filter” option. Now all the items become visible in the filter checkbox list or filtered list.
Read more >
'Accept' attribute of input element is not working - Stack Overflow
The filter inside the file browser dialog will not work. You could use a javascript validation on the form onsubmit event to verify...
Read more >
Excel Filter Not Working? Try These Fixes - TechNewsToday
However, there might be instances where the filter function might not be working properly. Usually, such an error pops up when there are ......
Read more >
Filter does not seem to work in Fiddler | Telerik Forums
1 Answer, 1 is accepted ... Hi Henrique,. The "Hide if URL contains" with a numerical value for port is working as expected...
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