Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chrome: file input with "multiple" and initial "value" causes DataTransferItemList error when adding more files #373

Closed
bizcmd opened this issue Jan 31, 2021 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@bizcmd
Copy link

bizcmd commented Jan 31, 2021

Describe the bug
A FormulateInput of type file and property multiple with an initial value set holding a length 1 array will generate an error in Chrome when adding another file to the list via the Add File button:

Failed to execute 'add' on 'DataTransferItemList': parameter 1 is not of type 'File'."

found in

---> <FormulateFiles>
       <FormulateInputFile>
         <FormulateInput>
           <FormulateForm>
             <Root>

In Safari, it works without error.

To Reproduce
Use CodePen below and click to add a new file. Chrome will immediately add it to the list visually (without the normal faux loader animations) and will produce console error as above.

CodePen:

https://codepen.io/flyfoxuk/pen/QWGwggm

Expected behavior
The selected file to be added without error to the file list.

Device information:

  • Mac
  • OS: 10.15.5
  • Browser [Chrome 88.0.4324.96]

Further info
Seems to be related to mergeFileList function in FileUpload.js ??

@bizcmd bizcmd added the bug report A submitted bug report, not yet validated. label Jan 31, 2021
@zgurea1
Copy link

zgurea1 commented Feb 5, 2021

same issue.

@justin-schroeder justin-schroeder added this to the 2.5.1 milestone Feb 5, 2021
@justin-schroeder justin-schroeder added bug Something isn't working and removed bug report A submitted bug report, not yet validated. labels Feb 5, 2021
@justin-schroeder
Copy link
Member

Ok, this is fixed in the release/2.5.1 branch 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants