Pass form data to remote form function enhance callback
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 20.8k
- Forks
- 2.3k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 156
Description
Describe the problem
It should be possible to mutate the form data in the remote form functions enhance callback like it is possible within the enhance action.
Describe the proposed solution
Pass a formData prop to the enhance callback function.
https://github.com/sveltejs/kit/blob/19211c15dcf70aaf3a07820abbee22bf7049dc1a/packages/kit/src/runtime/client/remote-functions/form.svelte.js#L100-L104 should be:
await callback({
form,
data,
+ formData: form_data,
submit: () => submit(form_data)
});
Alternatives considered
No response
Importance
nice to have
Additional Information
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in packages/kit/src/runtime/client/remote-functions/form.svelte.js at the enhance callback around lines 100-104, and inspect how form_data is passed to the callback and submit function. Update the callback contract so formData is available for mutation, then verify that remote form enhance callbacks can access it while existing form and submit behavior remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100