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

file-upload Svelte: acceptedFiles not in sync with hidden inputs contained files #2120

Open
aschulz90 opened this issue Dec 17, 2024 · 0 comments

Comments

@aschulz90
Copy link

🐛 Bug report

When clicking on the component and selecting a file adds it to the acceptedFiles list, instead of replacing it. This leads to inconsistent state between what is actually contained in the hidden input and the acceptedFiles list.

💥 Steps to reproduce

  1. click on Choose file(s) and select one or more files
  2. the selected file(s) gets listed
  3. click on Choose file(s) again and select one or multiple other files
  4. the previously selected file(s) and the newly selected file(s) get listed
  5. submit the form
  6. only the last selected file(s) gets submitted (see server log)

💻 Link to reproduction

CodeSandbox reproduction: https://codesandbox.io/p/devbox/lucid-maxwell-sm56jj

🧐 Expected behavior

Either acceptedFiles gets replaced with selected files everytime you select files; or selected files get somehow appended to the hidden input instead of replacing them.

🧭 Possible Solution

🌍 System information

Software Version(s)
Zag Version ^0.78.3
Browser Firefox 133.0.3, Chrome 131.0.6778.140
Operating System Windows 22631.4602

📝 Additional information

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