How to prevent non-matching files from being selectable in Uppy file dialog?

Hi,

I’m building an interface using Uppy Core, Dropzone, FilesList, and UppyContextProvider.

In my setup, I declare:

```js
new Uppy({
        restrictions: {
            maxNumberOfFiles: 20,
            maxFileSize: MAX_FILE_SIZE,
            allowedFileTypes: ['image/jpeg', '.jpg', '.jpeg'],
        },
    })
```

The file type restriction works when a user tries to select a non-image file, but non-image files are still clickable in the dialog. I was expecting behavior similar to the native ‎`accept` attribute of ‎``, which prevents non-matching files from being selectable.

Is there a way to achieve this?

Thank you,
Joffrey

Created an issue for it: Dropzone and FileInput should inherit accept settings from @uppy/core restrictions · Issue #5970 · transloadit/uppy · GitHub

1 Like