소스 검색

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();
 				}