Skip to content

Radio field does not reliably trigger admin.condition re-evaluation on sibling fields #15929

@kbarejko

Description

@kbarejko

Description

Radio fields (type: 'radio') do not reliably trigger admin.condition re-evaluation on sibling fields when used inside blocks (which are children of an array/blocks layout field).

Two concrete cases from production:

Case 1: Block-level radio — completely broken

A miniCasesSlider block has a sourceType radio field that toggles between collection and manual modes. Two sibling fields use admin.condition to show/hide based on this value. Changing the radio value has no effect — conditional fields never show/hide.

// Block config (inside layout blocks array)
{
  name: 'sourceType',
  type: 'radio', // ← does NOT trigger condition re-evaluation
  defaultValue: 'collection',
  options: [
    { label: 'From collection', value: 'collection' },
    { label: 'Manual', value: 'manual' },
  ],
  admin: { layout: 'horizontal' },
},
{
  name: 'selectedCases',
  type: 'relationship',
  relationTo: 'mini-cases',
  hasMany: true,
  admin: {
    condition: (_data, siblingData) => siblingData?.sourceType === 'collection',
  },
},
{
  name: 'manualCases',
  type: 'array',
  admin: {
    condition: (_data, siblingData) => siblingData?.sourceType === 'manual',
  },
  fields: [/* ... */],
},

Case 2: Link field radio — works intermittently with delay

The shared link field has a type radio (reference/custom) with conditions on reference and url fields. Toggling the radio works but with significant delay, and sometimes requires clicking back and forth multiple times before the conditional fields update.

// Inside a link group field, used across many blocks
{
  name: 'type',
  type: 'radio', // ← intermittent, delayed condition re-evaluation
  defaultValue: 'reference',
  admin: { layout: 'horizontal', width: '50%' },
  options: [
    { label: 'Internal link', value: 'reference' },
    { label: 'Custom URL', value: 'custom' },
  ],
},
{
  name: 'reference',
  type: 'relationship',
  admin: {
    condition: (_d, siblingData) => siblingData?.type !== 'custom',
  },
},
{
  name: 'url',
  type: 'text',
  admin: {
    condition: (_d, siblingData) => siblingData?.type === 'custom',
  },
},

Workaround

Changing from type: 'radio' to type: 'select' fixes both cases completely — conditions trigger instantly and reliably.

Important context: In the same project, 15+ other blocks use type: 'select' with the exact same admin.condition pattern (e.g., TestimonialsBlock, ArchiveBlock, RelatedPosts, ComparisonBlock, CallToAction) and all work correctly. Only radio fields exhibit this behavior.

Steps to Reproduce

  1. Create a block with a radio field and sibling fields that use admin.condition based on the radio value
  2. Add this block to a page's layout (blocks array field)
  3. In the admin panel, change the radio value
  4. Observe: conditional fields do not update (Case 1) or update only after multiple clicks with delay (Case 2)
  5. Change the field to type: 'select' — conditions work immediately

Expected Behavior

Changing a radio field value should trigger immediate re-evaluation of admin.condition on all sibling fields, identical to how select fields behave.

Versions

  • Payload: 3.79.0
  • Next.js: 16.1.6
  • Node: v22
  • Database: MongoDB

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions