فهرست منبع

Merge pull request #12586 from dehrax/12075-iframe-scroll

Prevent scroll on focus for iframe
David 7 سال پیش
والد
کامیت
64c77febef
1فایلهای تغییر یافته به همراه4 افزوده شده و 2 حذف شده
  1. 4 2
      public/app/core/components/scroll/page_scroll.ts

+ 4 - 2
public/app/core/components/scroll/page_scroll.ts

@@ -29,11 +29,13 @@ export function pageScrollbar() {
       scope.$on('$routeChangeSuccess', () => {
         lastPos = 0;
         elem[0].scrollTop = 0;
-        elem[0].focus();
+        // Focus page to enable scrolling by keyboard
+        elem[0].focus({ preventScroll: true });
       });
 
       elem[0].tabIndex = -1;
-      elem[0].focus();
+      // Focus page to enable scrolling by keyboard
+      elem[0].focus({ preventScroll: true });
     },
   };
 }