rc-virtual-list
Advanced tools
Comparing version 3.10.3 to 3.10.4
@@ -107,2 +107,7 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
}, []); | ||
// Pass to effect | ||
var enableScrollRangeRef = React.useRef(); | ||
enableScrollRangeRef.current = enableScrollRange; | ||
var enableOffsetRangeRef = React.useRef(); | ||
enableOffsetRangeRef.current = enableOffsetRange; | ||
React.useEffect(function () { | ||
@@ -125,6 +130,8 @@ if (dragging) { | ||
} | ||
var ptg = enableOffsetRange ? newTop / enableOffsetRange : 0; | ||
var newScrollTop = Math.ceil(ptg * enableScrollRange); | ||
var tmpEnableScrollRange = enableScrollRangeRef.current; | ||
var tmpEnableOffsetRange = enableOffsetRangeRef.current; | ||
var ptg = tmpEnableOffsetRange ? newTop / tmpEnableOffsetRange : 0; | ||
var newScrollTop = Math.ceil(ptg * tmpEnableScrollRange); | ||
newScrollTop = Math.max(newScrollTop, 0); | ||
newScrollTop = Math.min(newScrollTop, enableScrollRange); | ||
newScrollTop = Math.min(newScrollTop, tmpEnableScrollRange); | ||
moveRafId = raf(function () { | ||
@@ -131,0 +138,0 @@ onScroll(newScrollTop, horizontal); |
@@ -115,2 +115,7 @@ "use strict"; | ||
}, []); | ||
// Pass to effect | ||
var enableScrollRangeRef = React.useRef(); | ||
enableScrollRangeRef.current = enableScrollRange; | ||
var enableOffsetRangeRef = React.useRef(); | ||
enableOffsetRangeRef.current = enableOffsetRange; | ||
React.useEffect(function () { | ||
@@ -133,6 +138,8 @@ if (dragging) { | ||
} | ||
var ptg = enableOffsetRange ? newTop / enableOffsetRange : 0; | ||
var newScrollTop = Math.ceil(ptg * enableScrollRange); | ||
var tmpEnableScrollRange = enableScrollRangeRef.current; | ||
var tmpEnableOffsetRange = enableOffsetRangeRef.current; | ||
var ptg = tmpEnableOffsetRange ? newTop / tmpEnableOffsetRange : 0; | ||
var newScrollTop = Math.ceil(ptg * tmpEnableScrollRange); | ||
newScrollTop = Math.max(newScrollTop, 0); | ||
newScrollTop = Math.min(newScrollTop, enableScrollRange); | ||
newScrollTop = Math.min(newScrollTop, tmpEnableScrollRange); | ||
moveRafId = (0, _raf.default)(function () { | ||
@@ -139,0 +146,0 @@ onScroll(newScrollTop, horizontal); |
{ | ||
"name": "rc-virtual-list", | ||
"version": "3.10.3", | ||
"version": "3.10.4", | ||
"description": "React Virtual List Component", | ||
@@ -5,0 +5,0 @@ "engines": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
119877
3036