瀏覽代碼

Fix scroll behaviour

sbkwgh 6 年之前
父節點
當前提交
ba574e8633
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      frontend/src/components/SearchBox.vue

+ 3 - 1
frontend/src/components/SearchBox.vue

@@ -247,8 +247,10 @@
 				let { group, index } = this.getGroupFromIndex(this.highlightIndex);
 				let el = index === null ? this.$refs[group] : this.$refs[group][index];
 				if(
+					//Below fold
 					el.offsetHeight + el.offsetTop > this.$refs.results.offsetHeight ||
-					 el.offsetHeight + el.offsetTop < this.$refs.results.scrollTop
+					//Above fold
+					el.offsetTop < this.$refs.results.scrollTop
 				) {
 					el.scrollIntoView();
 				}