dynamic-virtual-scroller
Advanced tools
Comparing version 3.0.20 to 3.0.21
{ | ||
"name": "dynamic-virtual-scroller", | ||
"version": "3.0.20", | ||
"version": "3.0.21", | ||
"description": "A virtual scroller for the web that can handle dynamic row and column sizes.", | ||
@@ -26,3 +26,6 @@ "main": "virtual-scroller.js", | ||
"watch:js": "webpack --watch", | ||
"dev": "npm run build:css && npm run watch:js" | ||
"dev": "npm run build:css && npm run watch:js", | ||
"version:patch": "npm version patch -m ':bookmark: v%s'", | ||
"version:minor": "npm version minor -m ':bookmark: v%s'", | ||
"version:major": "npm version major -m ':bookmark: v%s'" | ||
}, | ||
@@ -29,0 +32,0 @@ "repository": { |
@@ -29,10 +29,13 @@ import {ATTRIBUTES, EVENTS, CLASSES} from "./constants"; | ||
if (!lastRowState) { | ||
return; | ||
return 0; | ||
} | ||
var maxScrollLeft = lastRowState.canvasSize - renderManager.sizeCache.containerWidth; | ||
return maxScrollLeft; | ||
return Math.max(maxScrollLeft, 0); | ||
}; | ||
// if state.canvasSize or sizeCache.containerHeight is not set yet, the result is NaN. In that case we return 0 | ||
var getMaxScrollTop = renderManager => (renderManager.state.canvasSize - renderManager.sizeCache.containerHeight) || 0; | ||
var getMaxScrollTop = renderManager => { | ||
// if state.canvasSize or sizeCache.containerHeight is not set yet, the result is NaN. In that case we return 0 | ||
const maxScrollTop = (renderManager.state.canvasSize - renderManager.sizeCache.containerHeight) || 0; | ||
return Math.max(maxScrollTop, 0); | ||
}; | ||
@@ -72,4 +75,4 @@ var debouncedResetIsScrolling = _.debounce(() => setIsScrolling(false), 100); | ||
scrollTop = Math.round(scrollTop); | ||
scrollTop = Math.min(scrollTop, maxScrollTop); | ||
scrollTop = Math.max(scrollTop, 0); | ||
scrollTop = Math.min(scrollTop, maxScrollTop); | ||
@@ -89,4 +92,4 @@ if (scrollTop !== state.scrollTop) { | ||
scrollLeft = Math.round(scrollLeft); | ||
scrollLeft = Math.min(scrollLeft, maxScrollLeft); | ||
scrollLeft = Math.max(scrollLeft, 0); | ||
scrollLeft = Math.min(scrollLeft, maxScrollLeft); | ||
@@ -93,0 +96,0 @@ if (scrollLeft !== state.scrollLeft) { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
7500
531900