Fiddle here
Bug:
Restrictions are not applied correctly.
Description:
In the fiddle I have two Uppy instances, in both using DragDrop, testing that the order of .use influence behavior when I apply a restriction for Uppy:
Uppy.Core().use(XHRUpload, {...}).use(DragDrop, {...}) - incorrect behaviorUppy.Core().use(DragDrop, {...}).use(XHRUpload, {...}) at the end I apply the same restriction for both, but in the first instance the restriction is not set even if the console log is what you would expect, when trying to upload a file, no restriction is there.
uppy1.opts.restrictions.allowedFileTypes = ['.jpg', '.xls'];
uppy2.opts.restrictions.allowedFileTypes = ['.jpg', '.xls'];
You can also inspect the elements:


Are you updating the options with precisely that line?
uppy.opts.restrictions.allowedFileTypes = [...list]
Manually setting options properties after passing them to Uppy is not supported. You have to use the setOptions() method because Uppy has to do some reinitialization if its settings are changed.
uppy.setOptions({
restrictions: {
allowedFileTypes: [...list]
}
})
Thanks for the answer!
Yes, I was using that line, it was before the setOptions was added :D