Explorar el Código

Fix scroll behaviour

sbkwgh hace 6 años
padre
commit
ba574e8633
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  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();
 				}