From 6d0a443a94f176434a58b4066b0eabff74a7547f Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Fri, 29 Nov 2024 15:34:06 +0100 Subject: [PATCH] fix: enable directory selection in file picker Although folder selection is possible, the callback does not receive the picked node unless `allowDirectories(true)` is explicitly set. Signed-off-by: Daniel Kesselberg --- src/components/Editor/Attachments/AttachmentsList.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/components/Editor/Attachments/AttachmentsList.vue b/src/components/Editor/Attachments/AttachmentsList.vue index 861e2a29a7..612631c8c4 100644 --- a/src/components/Editor/Attachments/AttachmentsList.vue +++ b/src/components/Editor/Attachments/AttachmentsList.vue @@ -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)) {