Skip to content

Commit 555e477

Browse files
committed
fix(qwik-router): submit() always rejects on abort; Form swallows its own rejection
1 parent 8e662a6 commit 555e477

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

packages/qwik-router/src/runtime/src/form-component.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ export const Form = <O, I>(
6565
!reloadDocument
6666
? $((evt: SubmitEvent) => {
6767
if (!action.submitted) {
68-
return action.submit(evt);
68+
// Swallow our own rejection — submitcompleted is the form's abort channel.
69+
return action.submit(evt).catch(() => {});
6970
}
7071
})
7172
: undefined,
@@ -86,7 +87,7 @@ export const Form = <O, I>(
8687
// Since v2, this fires before the action is executed so it can be prevented
8788
onSubmit$,
8889
// action.submit "submitcompleted" event for onSubmitCompleted$ events
89-
!reloadDocument ? action.submit : undefined,
90+
!reloadDocument ? $((evt: SubmitEvent) => action.submit(evt).catch(() => {})) : undefined,
9091
],
9192
method: 'post',
9293
['data-spa-reset']: spaReset ? 'true' : undefined,

packages/qwik-router/src/runtime/src/server-functions.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ Action.run() can only be called on the browser, for example when a user clicks a
134134
detail: detail,
135135
})
136136
);
137-
return { status, value: undefined, error: undefined };
138137
}
139138
throw aborted;
140139
}

0 commit comments

Comments
 (0)