Skip to content

Array with a single group containing conditional fields does not render on first collapsible expand #15613

@kubyshkin-vladyslav

Description

@kubyshkin-vladyslav

Describe the Bug

When an array field contains only a single group field that includes conditional fields using admin.condition, the array items inside a collapsible do not render correctly on the first expand after page load.

On the first expand, the array row appears empty sometimes.
If the collapsible is closed and opened again, the content renders correctly.

Link to the code that reproduces this issue

https://github.com/kubyshkin-vladyslav/payload-collapsible-array-bug

Reproduction Steps

  1. Clone the repository:
git clone https://github.com/kubyshkin-vladyslav/payload-collapsible-array-bug
  1. Navigate into the project and copy environment variables:
cd payload-collapsible-array-bug
cp .env.example .env
  1. Start MongoDB:
docker compose up -d mongo
  1. Install dependencies and start the dev server:
pnpm install
pnpm dev
  1. Open http://localhost:3000/admin in your browser and create the first admin user when prompted.
  2. Open http://localhost:3000/admin/globals/header in your browser
  3. In both main and secondary tabs create at least 10 Nav Items.
  4. Collapse all array items (so their collapsed state is stored in preferences).
  5. Refresh the page.
  6. Expand items one by one.

Observed behavior:

  • Some items expand empty on first open
Image
  • If you click “Show all”, there is a higher chance that multiple items expand empty
Image
  1. Collapse and expand the same item again - the content renders correctly.

Which area(s) are affected?

area: ui

Environment Info

Binaries:
  Node: 22.20.0
  npm: N/A
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  payload: 3.76.1
  next: 15.4.11
  @payloadcms/db-mongodb: 3.76.1
  @payloadcms/graphql: 3.76.1
  @payloadcms/next/utilities: 3.76.1
  @payloadcms/richtext-lexical: 3.76.1
  @payloadcms/translations: 3.76.1
  @payloadcms/ui/shared: 3.76.1
  react: 19.2.1
  react-dom: 19.2.1
Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
  Available memory (MB): 32545
  Available CPU cores: 20

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugarea: uiRelated to the admin panel.stalestatus: needs-triagePossible bug which hasn't been reproduced yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions