Skip to content

Commit

Permalink
Adjust the PickedItemPreviewComponent info
Browse files Browse the repository at this point in the history
  • Loading branch information
aatanasovdev committed Feb 22, 2025
1 parent 7b53574 commit 09c80bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/content-picker/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function MyComponent( props ) {
| `content` | `array` | `[]` | Array of items to pre-populate picker with. Must be in the format of: `[{id: 1, type: 'post', uuid: '...',}, {id: 1, uuid: '...', type: 'page'},... ]`. You cannot provide terms and posts to the same picker. `uuid` was added as of version 1.5.0. It is only used as the React component list key in the admin. If it is not included, `id` will be used which will cause errors if you select the same post twice. |
| `perPage` | `number` | `50` | Number of items to show during search
| `fetchInitialResults` | `bool` | `false` | Fetch initial results to present when focusing the search input |
| `PickedItemPreviewComponent` | `React.ComponentType<item>` | `undefined` | Allow replacing the default picked item preview. The `item` prop includes information about the selected entry (please check the `PickedItemType` interface in `./PickedItem.tsx`.js). | |
| `PickedItemPreviewComponent` | `React.ComponentType<item>` | `undefined` | Allow replacing the default picked item preview. The `item` prop includes information about the selected entry (please check the `PickedItemType` interface in `./PickedItem.tsx`). | |
__NOTE:__ Content picker cannot validate that posts you pass it via `content` prop actually exist. If a post does not exist, it will not render as one of the picked items but will still be passed back as picked items if new items are picked/sorted. Therefore, on save you need to validate that all the picked posts/terms actually exist.

The `contentTypes` will get used in a Rest Request to the `search` endpoint as the `subtypes`:
Expand Down

0 comments on commit 09c80bc

Please sign in to comment.