From 9fb5b2a37d9f2a2d5570d2ef5e3638492d356458 Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Fri, 12 Aug 2022 11:43:39 +0100 Subject: [PATCH] Delete the selected file only --- packages/bbui/src/Form/Core/Dropzone.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/bbui/src/Form/Core/Dropzone.svelte b/packages/bbui/src/Form/Core/Dropzone.svelte index 80f51f5dae..68882fe810 100644 --- a/packages/bbui/src/Form/Core/Dropzone.svelte +++ b/packages/bbui/src/Form/Core/Dropzone.svelte @@ -95,8 +95,10 @@ "change", value.filter((x, idx) => idx !== selectedImageIdx) ) + await deleteAttachments( + value.filter((x, idx) => idx === selectedImageIdx).map(item => item.key) + ) selectedImageIdx = 0 - await deleteAttachments(value.map(item => item.key)) } function navigateLeft() {