Поправки багов скроллинга

This commit is contained in:
Book Pauk
2022-10-31 15:33:58 +07:00
parent 4ea9b388f0
commit 820769071d
3 changed files with 12 additions and 5 deletions

View File

@@ -744,11 +744,13 @@ class Search {
}
onScroll() {
if (this.ignoreScrolling)
return;
const curScrollTop = this.$refs.scroller.scrollTop;
if (this.ignoreScrolling) {
this.lastScrollTop = curScrollTop;
return;
}
if (!this.lastScrollTop)
this.lastScrollTop = 0;
if (!this.lastScrollTop2)
@@ -756,6 +758,9 @@ class Search {
if (curScrollTop - this.lastScrollTop > 0) {
this.$refs.toolPanel.style.position = 'relative';
if (this.lastScrollTop2 <= curScrollTop - this.$refs.toolPanel.clientHeight)
this.lastScrollTop2 = 0;
this.$refs.toolPanel.style.top = `${this.lastScrollTop2}px`;
} else {
this.$refs.toolPanel.style.position = 'sticky';