fix: clear selection by clicking on empty area (#5663)

This commit is contained in:
Ariel Leyva
2026-01-10 04:05:12 -05:00
committed by GitHub
parent 464b581953
commit 208535a8cc

View File

@@ -159,6 +159,7 @@
ref="listing" ref="listing"
class="file-icons" class="file-icons"
:class="authStore.user?.viewMode ?? ''" :class="authStore.user?.viewMode ?? ''"
@click="handleEmptyAreaClick"
> >
<div> <div>
<div class="item header"> <div class="item header">
@@ -1051,4 +1052,18 @@ const showContextMenu = (event: MouseEvent) => {
const hideContextMenu = () => { const hideContextMenu = () => {
isContextMenuVisible.value = false; isContextMenuVisible.value = false;
}; };
const handleEmptyAreaClick = (e: MouseEvent) => {
const target = e.target;
if (!(target instanceof HTMLElement)) return;
if (target.closest("item") || target.closest(".item")) return;
fileStore.selected = [];
};
</script> </script>
<style scoped>
#listing {
min-height: calc(100vh - 8rem);
}
</style>