Skip to content

[6.x] Preserve settings input and errors after failed saves - #19775

Merged
riasvdv merged 3 commits into
6.xfrom
extract/19665-validation-state-retention-retry
Oct 1, 2026
Merged

riasvdv merged 3 commits into
6.xfrom
extract/19665-validation-state-retention-retry

Conversation

@riasvdv

@riasvdv riasvdv commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Description

Preserve settings form input and validation errors when a save fails, while allowing successful saves that redirect away to reset page state.

- preserveState = !(redirect && redirectUrl.value)
+ preserveState = redirect && redirectUrl.value ? 'errors' : true

Allow FormSaveOptions.preserveState to accept 'errors'. Explicit overrides, slideout saves, password confirmation, and submission payloads retain their existing behavior.

Extracts the validation-state change from #19665, originally authored by Nathaniel Hammond.

riasvdv and others added 2 commits October 1, 2026 10:13
Co-authored-by: Nathaniel Hammond <nathaniel@pixelandtonic.com>
Co-authored-by: Nathaniel Hammond <nathaniel@pixelandtonic.com>
@github-actions

github-actions Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

📚 Storybook previews

@craftcms/ui — open Storybook

No changed components detected in this Storybook.

resources/js — open Storybook

No changed components detected in this Storybook.

Co-authored-by: Nathaniel Hammond <nathaniel@pixelandtonic.com>
@riasvdv
riasvdv merged commit 0e9ac98 into 6.x Oct 1, 2026
23 checks passed
@riasvdv
riasvdv deleted the extract/19665-validation-state-retention-retry branch October 1, 2026 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant