Explorar o código

ScrollBar: cache bar width calculation

Leopoldthecoder %!s(int64=8) %!d(string=hai) anos
pai
achega
869600f4d5
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      src/utils/scrollbar-width.js

+ 2 - 1
src/utils/scrollbar-width.js

@@ -23,6 +23,7 @@ export default function() {
 
   const widthWithScroll = inner.offsetWidth;
   outer.parentNode.removeChild(outer);
+  scrollBarWidth = widthNoScroll - widthWithScroll;
 
-  return widthNoScroll - widthWithScroll;
+  return scrollBarWidth;
 };