Skip to content

Commit

Permalink
Fix pickChildren
Browse files Browse the repository at this point in the history
  • Loading branch information
benmerckx committed Dec 13, 2024
1 parent 36ff2cd commit e8166d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
10 changes: 4 additions & 6 deletions apps/dev/src/schema/Folder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ import {Config, Field} from 'alinea'
import {Page} from './Page.js'
import {LinkFields} from './example/LinkFields.js'

export const Folder = Config.type('Folder', {
export const Folder = Config.document('Folder', {
contains: [Page, LinkFields],
fields: {
title: Field.text('Title', {
width: 0.5
}),
path: Field.path('Path', {
width: 0.5
childrenLink: Field.entry('Pick children', {
help: `Show only children of the current entry`,
pickChildren: true
})
}
})
5 changes: 4 additions & 1 deletion src/picker/entry/EntryPicker.browser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@ export function EntryPickerModal({
{
_workspace: destination.workspace,
_root: destination.root,
_parentId: withNavigation ? destination.parentId ?? null : undefined,
_parentId:
withNavigation || pickChildren
? destination.parentId ?? null
: undefined,
_locale: destinationLocale
}
]
Expand Down

0 comments on commit e8166d7

Please sign in to comment.