-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
Describe the Bug
Bug Report: useAsTitle field loses clickability when certain fields are in defaultColumns
Environment:
- Payload Version: [your version]
- Next.js Version: 15.4.4
- Node.js Version: [your version]
Bug Description:
When a field with a custom Cell component is included in the defaultColumns array, it breaks
the useAsTitle functionality - the title field renders as plain text instead of clickable
links.
Steps to Reproduce:
- Create a collection with useAsTitle: 'title'
- Add a field with custom Cell component to defaultColumns
- The title field loses its clickable link behavior
Expected Behavior:
The useAsTitle field should always render as clickable links regardless of other fields in
defaultColumns.
Actual Behavior:
Title renders as instead of when certain fields are in defaultColumns.
Minimal Reproduction:
export const TestCollection: CollectionConfig = {
admin: {
useAsTitle: 'title',
defaultColumns: ['imageField', 'title'], // This breaks title links
},
fields: [
{
name: 'title',
type: 'text',
required: true,
},
{
name: 'imageField',
type: 'text',
admin: {
components: {
Cell: '@/components/CustomCell#CustomCell',
},
},
},
],
}
Workaround:
Remove the problematic field from defaultColumns and add it manually via the column selector.
Link to the code that reproduces this issue
Private repo
Reproduction Steps
Bug Description:
When a field with a custom Cell component is placed before the useAsTitle field in the defaultColumns array, the title field
loses its clickable link behavior and renders as plain text instead of links.
Steps to Reproduce:
- Create a collection with useAsTitle: 'title'
- Add a field with custom Cell component before the title in defaultColumns
- The title field loses clickable links and renders as instead of
Key Finding:
- ✅ Works: defaultColumns: ['title', 'imageField'] (Cell component after title)
- ❌ Broken: defaultColumns: ['imageField', 'title'] (Cell component before title)
Expected Behavior:
The useAsTitle field should render as clickable links regardless of position relative to other fields in defaultColumns.
Actual Behavior:
Title renders as non-clickable when a field with custom Cell component appears before it in the array.
HTML Output When Broken:
Mike Lee & Patrick Reynolds Live on Waiheke RadioHTML Output When Working:
Mike Lee & Patrick Reynolds Live on Waiheke RadioWorkaround:
Place the useAsTitle field first in defaultColumns array, before any fields with custom Cell components.
Which area(s) are affected? (Select all that apply)
Not sure
Environment Info
- Payload Version: 3.56.0
- Next.js Version: 15.4.4
- React Version: 19.1.0
- Node.js Version: 22.19.0
- Platform: Windows 11 Pro