Add file serialization support to the `form` component / `use_form_data` hook
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start with the form component and use_form_data hook, using PR #58 and the original feature in #7 for context. Resolve whether file fields use metadata, multipart upload, or both before implementing. Done means mixed file and regular fields serialize without a reload, the behavior is tested, and documentation is updated.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
POSTwhen the form is submitted, integrating with the router's navigation model. - Combination: send metadata for a GET-style/
pushStatenavigation while supporting an optional file payload.
Acceptance criteria
- Defining a form with one or more
<input type="file">fields does not break serialization of the other fields. - File fields are represented in the
use_form_data()output in a well-defined way (currently undocumented behavior). - No full page reload occurs on submit of a form with file inputs (consistent with #58).
- A test covers a form that mixes file inputs with regular fields.
- Documentation updated for file-field behaviour.
Related
- PR: #58
- Original feature: #7
- Lingua principale
- Python
- Stelle
- 15
- Fork
- 9
- Merge medio
- 9h 57m
- PR unite (30g)
- 2
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di reactive-python/reactpy-router
-
complexity: 0 (highest) priority: 1 (high) type: feature
reactive-python/reactpy-router#32 · 1 assegnatario ·
-
complexity: 2 (medium) priority: 3 (low) type: feature
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
Tutte le issue di reactive-python/reactpy-router
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
learningequality/ricecooker#747 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
BSData/horus-heresy-3rd-edition#3171 ·
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
run-llama/llama_index#23199 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
KhronosGroup/glTF-Blender-IO#2769 ·