Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/every-bears-clean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

fix: allow access to root-level issues in schema-less forms
2 changes: 1 addition & 1 deletion packages/kit/src/exports/public.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2058,7 +2058,7 @@ export type RemoteForm<Input extends RemoteFormInput | void, Output> = {
/** The number of pending submissions */
get pending(): number;
/** Access form fields using object notation */
fields: Input extends void ? never : RemoteFormFields<Input>;
fields: RemoteFormFields<Input>;
/** Spread this onto a `<button>` or `<input type="submit">` */
buttonProps: {
type: 'submit';
Expand Down
2 changes: 2 additions & 0 deletions packages/kit/test/types/remote.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,8 @@ function form_tests() {
invalid.x('bar')
);
});
f8.fields.issues();
f8.fields.allIssues();
// @ts-expect-error
f8.fields.x;
// @ts-expect-error
Expand Down
2 changes: 1 addition & 1 deletion packages/kit/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2034,7 +2034,7 @@ declare module '@sveltejs/kit' {
/** The number of pending submissions */
get pending(): number;
/** Access form fields using object notation */
fields: Input extends void ? never : RemoteFormFields<Input>;
fields: RemoteFormFields<Input>;
/** Spread this onto a `<button>` or `<input type="submit">` */
buttonProps: {
type: 'submit';
Expand Down
Loading