fix(ui): keep form modified after any failed submit, not just drafts - #17534
Open
ikhana wants to merge 1 commit into
Open
fix(ui): keep form modified after any failed submit, not just drafts#17534ikhana wants to merge 1 commit into
ikhana wants to merge 1 commit into
Conversation
ikhana
requested review from
AlessioGr,
JarrodMFlesch and
jacobsfletch
as code owners
July 29, 2026 06:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
When a save request fails, the form is left marked as unmodified. This disables the "Save draft" button even though the user's unsaved changes are still sitting in the form.
Why?
setModified(false)runs after every submit request completes, regardless of whether it succeeded. The error branch then only restores the modified state when the submission was a draft (_status === 'draft').So a failed publish, or any failed save on a collection without drafts enabled, leaves the form looking clean when it isn't. To an editor this reads as "my changes were saved": the save buttons are greyed out, so they navigate away and the work is lost.
The intent is already documented in that branch's existing comment, "keep the form as modified so the save button remains enabled for retry". It was just scoped to drafts only.
Steps to reproduce
titleHow?
Moves
setModified(true)out of the draft-only condition. If the request failed, the document was not persisted, so the form is still modified relative to what is stored and the save buttons should stay enabled for a retry.Draft-specific behaviour is unchanged:
setSubmitted(false)still only runs for drafts whenvalidateDraftsis off, so failed draft saves continue not to trigger visible validation.Fixes #17517