Skip to content

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

Open
@Mika56

Description

@Mika56

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions