Skip to content
Open
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
5 changes: 5 additions & 0 deletions .changeset/fix-autosave-form-reset.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@emdash-cms/admin": patch
---

Fixes autosave form reset bug. Autosave no longer invalidates the query cache, preventing form fields from reverting to server state after autosave completes.
4 changes: 2 additions & 2 deletions packages/admin/src/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -622,8 +622,8 @@ function ContentEditPage() {
}) => updateContent(collection, id, { ...data, skipRevision: true }),
onSuccess: () => {
setLastAutosaveAt(new Date());
// Silently update the cache without full invalidation
void queryClient.invalidateQueries({ queryKey: ["content", collection, id] });
// Don't invalidate queries on autosave to prevent form reset
// The local form state is the source of truth during editing
},
onError: (err) => {
toastManager.add({
Expand Down
Loading