Open
Description
Describe the Bug
If we have a collection where a relationship field is identified as searchable:
export const Orders: CollectionConfig = {
slug: 'orders',
admin: {
useAsTitle: 'orderNumber',
listSearchableFields: ['customer'], // <--- field is relationship type
},
fields: [
{
name: 'orderNumber',
type: 'text',
required: true,
},
{
name: 'date',
type: 'date',
},
{
name: 'product',
type: 'relationship',
relationTo: 'products',
},
{
name: 'customer',
type: 'relationship',
relationTo: 'customers',
},
],
}
The field appears to the user as searchable (in the list search placeholder) but nothing happens.
2025-01-17_15-46-03.mp4
Link to the code that reproduces this issue
https://github.com/mfilteau/payload-bugs
Reproduction Steps
- Seed the database
http://localhost:3000/api/seed
-
Go to the Orders list view in admin panel
-
See that the list should be searchable by Customer
-
Try entering a customer name in the search box.
Nothing happens.
Which area(s) are affected? (Select all that apply)
area: ui
Environment Info
Binaries:
Node: 20.10.0
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant Packages:
payload: 3.17.1
next: 15.1.0
@payloadcms/db-mongodb: 3.17.1
@payloadcms/email-nodemailer: 3.17.1
@payloadcms/graphql: 3.17.1
@payloadcms/next/utilities: 3.17.1
@payloadcms/payload-cloud: 3.17.1
@payloadcms/richtext-lexical: 3.17.1
@payloadcms/translations: 3.17.1
@payloadcms/ui/shared: 3.17.1
react: 19.0.0
react-dom: 19.0.0
Operating System:
Platform: win32
Arch: x64
Version: Windows 11 Pro
Available memory (MB): 65457
Available CPU cores: 16