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

FileUploader: files not fully synchronized with underlying input #1785

Open
brunnerh opened this issue Jul 23, 2023 · 0 comments
Open

FileUploader: files not fully synchronized with underlying input #1785

brunnerh opened this issue Jul 23, 2023 · 0 comments

Comments

@brunnerh
Copy link
Contributor

In the "edit" state, files can be removed, but the invisible file input will still contain them, so with a regular form post, they are still submitted. Programmatically changing the files property will also have no effect on the input. FileUploaderDropContainer should have the same issue.

REPL demo

A note on a potential fix approach:
The input.files property can be set, but FileList objects cannot easily be constructed (at least last time I checked). A common way around this is to use a DataTransfer.

const data = new DataTransfer(); 
data.items.add(file);
input.files = data.files;

Related/overlap with:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant