Browse Source

fix: when navigating, scroll to top

Marcus Efraimsson 8 năm trước cách đây
mục cha
commit
1db9aeaac3
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      public/app/core/components/scroll/scroll.ts

+ 4 - 0
public/app/core/components/scroll/scroll.ts

@@ -8,6 +8,10 @@ export function geminiScrollbar() {
 
       let scrollbar = new PerfectScrollbar(elem[0]);
 
+      scope.$on('$routeChangeSuccess', () => {
+        elem[0].scrollTop = 0;
+      });
+
       scope.$on('$destroy', () => {
         scrollbar.destroy();
       });