Following https://github.com/payloadcms/payload/pull/10551, I found and fixed a handful more bugs: - When writing to the input, the results that were already there were not cleaned, causing incorrect results to appear. - the scroll was causing an infinite loop that showed repeated elements - optimization: only the required field is selected (not required) - refs are set to the initial value to avoid a state where nothing can be searched
22 lines
404 B
TypeScript
22 lines
404 B
TypeScript
import type { CollectionConfig } from 'payload'
|
|
|
|
import { with300DocumentsSlug } from '../slugs.js'
|
|
|
|
export const with300Documents: CollectionConfig = {
|
|
slug: with300DocumentsSlug,
|
|
admin: {
|
|
useAsTitle: 'text',
|
|
},
|
|
fields: [
|
|
{
|
|
name: 'text',
|
|
type: 'text',
|
|
},
|
|
{
|
|
name: 'selfRelation',
|
|
type: 'relationship',
|
|
relationTo: with300DocumentsSlug,
|
|
},
|
|
],
|
|
}
|