-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed as duplicate of#14477
Description
Describe the problem
In PR #14383 (Validated forms), the form enhance callback was changed to pass a converted POJO instead of the raw FormData
object. This change removes the ability to modify form data before submission, which is a significant regression for developers who need to alter form elements programmatically.
The Issue:
- Current behavior: The enhance callback now receives a POJO created by
convert_formdata()
- Problem: Modifications to this POJO are ignored during submission
- Root cause: The original
FormData
object is still used for the actual form submission (as seen in lines 93-97)
Use Case:
I need to modify form data programmatically before submission (e.g., uploading files to a different server).
Describe the proposed solution
Either:
- Restore FormData access: Pass the original
FormData
object to the enhance callback alongside or instead of the POJO - Make POJO changes effective: Ensure that modifications to the POJO are reflected in the actual form submission
- Provide both: Pass both the
FormData
and POJO, allowing developers to choose the appropriate method for their use case
Alternatives considered
No response
Importance
i cannot use SvelteKit without it
Additional Information
The conversion to POJO appears to be primarily for the validated forms feature, but this shouldn't break existing functionality for developers who need to manipulate form data directly.
PatrickG, andreasbhansen and SamuelCharpentier
Metadata
Metadata
Assignees
Labels
No labels