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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
- Migrated the reassign entries, replace relations, and replace references modals to the Form API. ([#19589](https://github.com/craftcms/cms/pull/19589))
- Restored Score sorting for element index searches and preserved previous sort fields as tie-breakers. ([#19731](https://github.com/craftcms/cms/pull/19731))
- Fixed a bug where the Edit and View bulk actions did nothing on element indexes. ([#19747](https://github.com/craftcms/cms/pull/19747))
- Fixed a bug where failed settings saves could lose input and validation errors when a successful save would redirect to another page. ([#19775](https://github.com/craftcms/cms/pull/19775))
- Fixed a bug where money inputs could be hidden within fields or submit their values under the wrong name. ([#19767](https://github.com/craftcms/cms/pull/19767))
- Fixed a bug where visually-hidden labels, headings, and status messages were visible on some control panel pages.
- Fixed a bug where `<craft-input>` fields with a `maxlength` weren’t sized to fit it, which made the element index pagination’s page input overlap the “Next page” button.
Expand Down
2 changes: 1 addition & 1 deletion resources/js/common/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ export type ActionItems = Array<ActionItem>;
export interface FormSaveOptions {
redirect?: boolean;
data?: FormValues;
preserveState?: boolean;
preserveState?: boolean | 'errors';
}

export interface EntryType {
Expand Down
3 changes: 2 additions & 1 deletion resources/js/modules/settings/composables/useSettingsSave.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ export function useSettingsSave<T extends object>(
data: extraData = {},
// Reset page state when this screen sends the user elsewhere, while saves
// that remain on the current screen keep their local state by default.
preserveState = !(redirect && redirectUrl.value),
// Validation failures preserve input and errors instead of remounting.
preserveState = redirect && redirectUrl.value ? 'errors' : true,
}: FormSaveOptions = {}) {
options.onBeforeSave?.();

Expand Down
Loading