Skip to content

Commit

Permalink
fix: enable directory selection in file picker
Browse files Browse the repository at this point in the history
Although folder selection is possible, the callback does not receive the picked node unless `allowDirectories(true)` is explicitly set.

Signed-off-by: Daniel Kesselberg <[email protected]>
  • Loading branch information
kesselb committed Dec 3, 2024
1 parent dadd442 commit 6d0a443
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/components/Editor/Attachments/AttachmentsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,15 @@ export default {
})
},
async openFilesModal() {
const picker = getFilePickerBuilder(t('calendar', 'Choose a file to add as attachment')).setMultiSelect(false).build()
const picker = getFilePickerBuilder(t('calendar', 'Choose a file to add as attachment'))
.setMultiSelect(false)
.allowDirectories(true)
.addButton({
label: t('calendar', 'Pick'),
type: 'primary',
callback: (nodes) => logger.debug('Picked attachment', { nodes }),
})
.build()
try {
const filename = await picker.pick(t('calendar', 'Choose a file to share as a link'))
if (!this.isDuplicateAttachment(filename)) {
Expand Down

0 comments on commit 6d0a443

Please sign in to comment.