feat(remote form): expose submitted property#14811
feat(remote form): expose submitted property#14811hrueger wants to merge 9 commits intosveltejs:mainfrom
submitted property#14811Conversation
🦋 Changeset detectedLatest commit: 1118567 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Pull request overview
This PR exposes the submitted property of remote forms to enable developers to track whether a form has been submitted at least once. This is particularly useful for controlling when to display form field validity UI, which should typically only appear after the user has attempted to submit the form.
Key Changes
- Made
submittedreactive by converting it from a plain variable to$state(false) - Added a getter for
submittedto the RemoteForm object - Updated TypeScript definitions in both public API and type definition files
Reviewed changes
Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
packages/kit/src/runtime/client/remote-functions/form.svelte.js |
Converted submitted to reactive state and exposed it via a getter property |
packages/kit/src/exports/public.d.ts |
Added TypeScript definition for the submitted getter |
packages/kit/types/index.d.ts |
Added TypeScript definition for the submitted getter |
.changeset/spicy-plants-begin.md |
Added changeset documenting this as a minor feature addition |
|
I added the new feature to a test as Copilot recomended, but I'm unsure why it is |
Hi,
this exposes the
submittedproperty of a remote form. This allows for displaying validity ui for form fields, as they should sometimes only appear after the form being submitted by the user.I'm not sure if a test for this is needed. If so, please let me know and I'll look into that.
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.Edits