fix: clear selection by clicking on empty area (#5663)
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user