mirror of
https://github.com/filebrowser/filebrowser.git
synced 2026-01-22 18:27:42 +00:00
fix: clear selection by clicking on empty area (#5663)
This commit is contained in:
parent
464b581953
commit
208535a8cc
1 changed files with 15 additions and 0 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue