payloadcms / payloadcms/payload

Autosave can overwrite recently typed field values and reload the media library

Open
#17,676 1 comment 0 reactions 0 assignees View on GitHub

@jacobsfletch is already working on this.

Since Jul 22, 2026.

  • #17455 by @jacobsfletch — open
area: ui status: needs-triage v3
Dominant language
TypeScript
Stars
44.8k
Forks
4.2k
Avg merge
2d 21h
Merged PRs (30d)
53

Description

Describe the Bug

When editing a draft in the Payload admin, autosave can overwrite recently typed field values.

If we start typing in one field, move to another field, and continue typing before the previous autosave request has completed, text in the first field sometimes reverts to its earlier value.

A related issue occurs with the media library: if we edit a field and quickly open the media library before autosave completes, the media picker flickers and appears to reload.

This makes creating page layouts frustrating, because editors need to wait for autosave to finish between edits to avoid losing input or having the media library refresh.

We have also tested longer autosave intervals, including 800ms and 1000ms. The issue still occurs; a longer interval only changes how easy it is to trigger.

Videos:

https://github.com/user-attachments/assets/e8316c85-fa88-4d9b-986c-4c91dd15c75f
https://github.com/user-attachments/assets/da9f6674-970b-4b82-9dbb-953d599e02e4

Link to the code that reproduces this issue

https://github.com/beyondwebb/payload-issue/tree/autosave-reproduction

Reproduction Steps
  1. Create a collection with drafts and autosave enabled:

    versions: {
      drafts: {
        autosave: {
          interval: 100,
        },
      },
    },
    
    
  2. Open a document in the admin panel and begin editing it.

  3. Type text into a text field.

  4. Immediately move to another field and continue typing while the first autosave is still pending.

  5. Observe that the first field may lose some of the entered text.

To reproduce the media picker issue:

  1. Edit a field in a draft-enabled document.

  2. Before autosave finishes, open an upload/media field and wait for the loading screen to finish.

  3. Observe that the media library reloads during the interaction.

Which area(s) are affected?

area: ui

Environment Info
Payload: 3.87.0, Next.js: 15.4.11, Node.js: v20.9.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the autosave reproduction branch linked in the issue and reproduce the draft editing and media-picker sequences using the shown 100ms autosave configuration. Trace the admin panel's pending autosave behavior while switching fields or opening media, then verify that recently typed values remain intact and the media library does not reload during the interaction.

Written by the indexing model from the issue text.

Assessment

Tech stack
next.js, react, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.