From 004488c15b3c30784e1ea564b3ca9feec7bcad08 Mon Sep 17 00:00:00 2001 From: Ariel Leyva Date: Sat, 24 Jan 2026 08:42:00 -0500 Subject: [PATCH] fix: avoid clearing selection when clicking elements outside the empty area (#5715) --- frontend/src/views/files/FileListing.vue | 28 ++++++++++++++++-------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/frontend/src/views/files/FileListing.vue b/frontend/src/views/files/FileListing.vue index c9f636ba..0a86b359 100644 --- a/frontend/src/views/files/FileListing.vue +++ b/frontend/src/views/files/FileListing.vue @@ -81,7 +81,13 @@ -
+
{{ t("prompts.filesSelected", fileStore.selectedCount) }} @@ -158,6 +164,7 @@ id="listing" ref="listing" class="file-icons" + data-clear-on-click="true" :class="authStore.user?.viewMode ?? ''" @click="handleEmptyAreaClick" > @@ -205,11 +212,12 @@
-

+

{{ t("files.folders") }}

-

+

{{ t("files.files") }}

{ const target = e.target; if (!(target instanceof HTMLElement)) return; - if (target.closest("item") || target.closest(".item")) return; - - // Do not clear selection when clicking on context menu actions - if (target.closest(".context-menu")) return; - - fileStore.selected = []; + if (target.dataset.clearOnClick === "true") { + fileStore.selected = []; + } };