Skip to content

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

Description

@beyondwebb

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

Activity

  1. added
    status: needs-triage
    validate-reproduction
    on Aug 6, 2026
  2. added
    area: ui
    and removed
    validate-reproduction
    on Aug 6, 2026
  3. lucasvass1 commented on Aug 6, 2026

    @lucasvass1

    Vou trabalhar nesse erro!

  4. added a commit that references this issue on Nov 23, 2026
    7c766ec
  5. removed
    status: needs-triage
    on Nov 23, 2026
  6. github-actions commented on Nov 24, 2026

    @github-actions
    Contributor

    🚀 This is included in version v4.0.0-beta.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Payload OSSarea: uiv3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions