Skip to content

Commit

Permalink
fix: fix user scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
RWDai committed Aug 29, 2024
1 parent d1d2e1b commit e329b1c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src-tauri/config/conf-default.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ version = "0.1.0"

[cs]
[csm.processor]
concurrent = 4
concurrent = 3
8 changes: 4 additions & 4 deletions src/components/FileList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,17 @@ onMounted(() => {
const handleScroll = () => {
const element = scrollContainer.value!;
if (element.scrollTop + element.clientHeight >= element.scrollHeight - 5) {
userScrolled.value = true;
} else {
if (element.scrollTop + element.clientHeight >= element.scrollHeight - 28) {
userScrolled.value = false;
} else {
userScrolled.value = true;
}
};
// 自动滚动到底部,除非用户手动调整了滚动条
watchEffect(() => {
if (!userScrolled.value && fileList.value.length > 8 && scrollContainer.value) {
scrollContainer.value.scrollTop = scrollContainer.value.scrollHeight;
scrollContainer.value.scrollTop = scrollContainer.value.scrollHeight - scrollContainer.value.clientHeight;
}
});
Expand Down

0 comments on commit e329b1c

Please sign in to comment.