Skip to content

Problems with File Upload field #448

@prontiol

Description

@prontiol

I'm having really hard times trying to make input[type=file] play nicely with mobx-react-form.
It doesn't work out of the box and native behavior is broken.
When a file is chosen field.files property got updated, but:

  1. Native input is not updated (still shows: "No file selected")
  2. Validation of the field is not called, so the form is still rendered invalid
  3. form.values() does not contain files selected, so basically you have to implement your own method to collect all the values

Can someone provide a very simple and limited example of the form with one required input[type=file] with form validation on file selection change and collecting the data for submit without picking data from the field itself?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions