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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -159,6 +159,7 @@
ref="listing"
class="file-icons"
:class="authStore.user?.viewMode ?? ''"
@click="handleEmptyAreaClick"
>
<div>
<div class="item header">
@ -1051,4 +1052,18 @@ const showContextMenu = (event: MouseEvent) => {
const hideContextMenu = () => {
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>
<style scoped>
#listing {
min-height: calc(100vh - 8rem);
}
</style>