Browse Source

Fix scroll behaviour

sbkwgh 6 năm trước cách đây
mục cha
commit
ba574e8633
1 tập tin đã thay đổi với 3 bổ sung1 xóa
  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();
 				}