Yuki Takei преди 2 години
родител
ревизия
55b2c1ea86
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      apps/app/src/components/SearchPage/SearchResultContent.tsx

+ 2 - 1
apps/app/src/components/SearchPage/SearchResultContent.tsx

@@ -77,7 +77,8 @@ const scrollToFirstHighlightedKeyword = (scrollElement: HTMLElement): void => {
     return;
   }
 
-  animateScroll.scrollTo(toElem.offsetTop - SCROLL_OFFSET_TOP, {
+  const distance = toElem.getBoundingClientRect().top - scrollElement.getBoundingClientRect().top - SCROLL_OFFSET_TOP;
+  animateScroll.scrollMore(distance, {
     containerId: scrollElement.id,
     duration: 200,
   });