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

[Bug] Adding then removing an invalid file prevents form submission #1032

Open
2 tasks done
Mika56 opened this issue Jan 14, 2025 · 2 comments
Open
2 tasks done

[Bug] Adding then removing an invalid file prevents form submission #1032

Mika56 opened this issue Jan 14, 2025 · 2 comments
Labels

Comments

@Mika56
Copy link

Mika56 commented Jan 14, 2025

Is there an existing issue for this?

  • I have searched the existing issues

Have you updated FilePond and its plugins?

  • I have updated FilePond and its plugins

Describe the bug

After an invalid file (not allowed extension) is added, the form can not be sent anymore. Browser says: "Field contains invalid files"

Reproduction

https://codesandbox.io/s/filepond-demo-forked-tzqg9h?file=/index.html:399-400

<form method="post" enctype="multipart/form-data">
    <input type="file" name="filepond" multiple="multiple" accept="image/*" />
    <input type="submit" />
</form>
registerPlugin(FilePondPluginFileValidateType);

const input = document.querySelector('input[type="file"]');

create(input, {
  acceptedFileTypes: ["image/*"],
  storeAsFile: true,
  checkValidity: true
});

Press Browse and add a forbidden file, such as a .mp3 or .exe. Press upload. The browser reports that the form is invalid, which is correct. Add a second, valid file, and remove the invalid file. Press submit. The browser still report that the form is invalid, which is not correct this time.

Environment

- Device: PC
- OS: Windows 11
- Browser: Edge 131, Firefox 134
@Mika56 Mika56 added the bug label Jan 14, 2025
@rikschennink
Copy link
Collaborator

Reproduced, will try to address as soon as possible. PR is welcome as well.

@rikschennink
Copy link
Collaborator

Should be fixed in 4.32.7

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

No branches or pull requests

2 participants