Skip to content

Commit a26e565

Browse files
committed
Timers were cancelled to early in SPA and when validation failed.
1 parent 60ca652 commit a26e565

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ Headlines: Added, Changed, Deprecated, Removed, Fixed, Security
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [Unreleased]
9+
10+
### Fixed
11+
12+
- When cancelling a request, timers were cancelled too early in [SPA mode](https://superforms.rocks/concepts/spa) and when [client-side validation](https://superforms.rocks/concepts/client-validation) failed.
13+
814
## [1.10.2] - 2023-11-14
915

1016
### Fixed

src/lib/client/formEnhance.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ export function formEnhance<T extends AnyZodObject, M>(
293293
);
294294

295295
if (!validation.valid) {
296-
cancel();
296+
cancel(false);
297297

298298
const result = {
299299
type: 'failure' as const,
@@ -339,7 +339,7 @@ export function formEnhance<T extends AnyZodObject, M>(
339339
: (submit as { data: FormData }).data;
340340

341341
if (options.SPA) {
342-
cancel();
342+
cancel(false);
343343

344344
const validationResult = { ...validation, posted: true };
345345

0 commit comments

Comments
 (0)