payloadcms / payloadcms/payload
Array with a single group containing conditional fields does not render on first collapsible expand
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 44.8k
- Forks
- 4.2k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 53
Description
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
- Clone the repository:
git clone https://github.com/kubyshkin-vladyslav/payload-collapsible-array-bug
- Navigate into the project and copy environment variables:
cd payload-collapsible-array-bug
cp .env.example .env
- Start MongoDB:
docker compose up -d mongo
- Install dependencies and start the dev server:
pnpm install
pnpm dev
- Open
http://localhost:3000/adminin your browser and create the first admin user when prompted. - Open
http://localhost:3000/admin/globals/headerin your browser - In both main and secondary tabs create at least 10
Nav Items. - Collapse all array items (so their collapsed state is stored in preferences).
- Refresh the page.
- Expand items one by one.
Observed behavior:
- Some items expand empty on first open
- If you click “Show all”, there is a higher chance that multiple items expand empty
- 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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue using the linked payload-collapsible-array-bug project, starting at /admin/globals/header with collapsed array items containing conditional fields. Trace the admin UI's collapsible array rendering and verify behavior after refresh and first expansion. Done means every item renders its content correctly on the first expand, including when “Show all” is used.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nextjs, react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100