diff --git a/src/main.js b/src/main.js index 6591cddb..4d6d6f2a 100644 --- a/src/main.js +++ b/src/main.js @@ -30,6 +30,8 @@ const scrollToElement = (searchEngine, element) => { // scroll element to bottom element.scrollIntoView(false); window.scrollBy(0, bottomMargin); + } else { + window.scrollTo(0, elementBounds.top + window.pageYOffset - (window.innerHeight / 2)); } return Math.abs(window.scrollY - scrollY) > 0.01; };