yohei0125 4 лет назад
Родитель
Сommit
428ce8ab35

+ 0 - 5
packages/app/src/client/util/smooth-scroll.ts

@@ -23,11 +23,6 @@ export const jQuerySlimScrollIntoView = (scrollableElement: HTMLElement, scrollT
 
   const scrollTo = targetTop - offsetTop;
   (<any>$(scrollableElement)).slimScroll({ scrollTo });
-  /**
-   * the following code is a workaround since the scrollbar doesn't move without mouseover event after applying slimscroll
-   * https://github.com/rochal/jQuery-slimScroll/issues/287#issuecomment-797090432
-   */
-  (<any>$(scrollableElement)).trigger('mouseover');
 };
 
 export type SmoothScrollEventCallback = (elem: HTMLElement) => void;

+ 7 - 0
packages/app/src/components/StickyStretchableScroller.jsx

@@ -90,6 +90,13 @@ const StickyStretchableScroller = (props) => {
       allowPageScroll: true,
     });
 
+    /**
+     * The below code is a workaround for the following effect
+     * The scrollbar doesn't move without mouseover event after applying slimscroll
+     * https://github.com/rochal/jQuery-slimScroll/issues/287#issuecomment-797090432
+     */
+    $(scrollTargetSelector).trigger('mouseover');
+
     // destroy
     if (!isScrollEnabled) {
       $(scrollTargetSelector).slimScroll({ destroy: true });