Description
Follow-up to #58 (the form component and use_form_data hook, which closed #7).
The form component's client-side interception currently serializes non-file fields only. File inputs (<input type="file">) are silently excluded because the submission handler iterates FormData entries and calls .toString() on each value, which for File objects yields [object File] and loses the file content.
The PR description for #58 explicitly deferred this:
Non-file fields only; file serialization is deferred.
Proposed scope
Support forms that contain file inputs, matching how the current behavior treats other input types. Possible options to evaluate:
- Include file metadata (name, size, type, lastModified) in the serialized form data, without uploading file content — useful for validation/UI feedback on the server.
- Defer file content upload to a separate multipart
POST when the form is submitted, integrating with the router's navigation model.
- Combination: send metadata for a GET-style/
pushState navigation while supporting an optional file payload.
Acceptance criteria
Related
Description
Follow-up to #58 (the
formcomponent anduse_form_datahook, which closed #7).The
formcomponent's client-side interception currently serializes non-file fields only. File inputs (<input type="file">) are silently excluded because the submission handler iteratesFormDataentries and calls.toString()on each value, which forFileobjects yields[object File]and loses the file content.The PR description for #58 explicitly deferred this:
Proposed scope
Support forms that contain file inputs, matching how the current behavior treats other input types. Possible options to evaluate:
POSTwhen the form is submitted, integrating with the router's navigation model.pushStatenavigation while supporting an optional file payload.Acceptance criteria
<input type="file">fields does not break serialization of the other fields.use_form_data()output in a well-defined way (currently undocumented behavior).formcomponent anduse_form_datahook #58).Related
formcomponent anduse_form_datahook #58formcomponent #7