Skip to content

Multi Upload Field - Bulk Upload - Drawer Context not cleaned #12998

Open
@tsemachh

Description

@tsemachh

Describe the Bug

When using upload field with hasMany , the bulk upload is enabled
Issue is that after you drag files and save them , once you open again the Create New it keeps the old files and eventually you are getting them twice in the field
Expected behavior is that the Drawer is cleared upon saving the documents and Create New is opening brand new drawer

Screenshare.-.2025-07-01.4_20_11.PM.mp4

@JarrodMFlesch FYI

Link to the code that reproduces this issue

https://github.com/shefing/bulkuploadbug

Reproduction Steps

Take the Web Template:
On src/collections/Posts/index.ts
Add the following the field named multiUpload:
src/collections/Posts/index.ts

          fields: [
            {
              name: 'multiUpload',
              type: 'upload',
              relationTo: 'media',
              hasMany: true
            },
            {
              name: 'heroImage',
              type: 'upload',
              relationTo: 'media',
            },

Reproduction:

  1. Drag 3 items to the the field
  2. save
  3. Press Create New
  4. Drawer is opened with the old 3 then you add another one
  5. The first 3 are added again to the Upload field
    I think the BulkUpload Drawer should be cleared after saving the first 3

Which area(s) are affected? (Select all that apply)

area: ui

Environment Info

Binaries:
  Node: 23.1.0
  npm: 11.1.0
  Yarn: 1.22.22
  pnpm: 9.13.2
Relevant Packages:
  payload: 3.44.0
  next: 15.3.3
  @payloadcms/db-mongodb: 3.44.0
  @payloadcms/email-nodemailer: 3.44.0
  @payloadcms/graphql: 3.44.0
  @payloadcms/live-preview: 3.44.0
  @payloadcms/live-preview-react: 3.44.0
  @payloadcms/next/utilities: 3.44.0
  @payloadcms/payload-cloud: 3.44.0
  @payloadcms/plugin-form-builder: 3.44.0
  @payloadcms/plugin-nested-docs: 3.44.0
  @payloadcms/plugin-redirects: 3.44.0
  @payloadcms/plugin-search: 3.44.0
  @payloadcms/plugin-seo: 3.44.0
  @payloadcms/richtext-lexical: 3.44.0
  @payloadcms/translations: 3.44.0
  @payloadcms/ui/shared: 3.44.0
  react: 19.1.0
  react-dom: 19.1.0
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:49 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6000
  Available memory (MB): 32768
  Available CPU cores: 10

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions