Socket
Socket
Sign inDemoInstall

virtual-scroller

Package Overview
Dependencies
3
Maintainers
1
Versions
78
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.12.5 to 1.12.6

18

commonjs/getVerticalSpacing.js

@@ -45,3 +45,3 @@ "use strict";

if (Math.ceil(itemTopOffset) >= Math.floor(firstShownRowTopOffset) + Math.floor(firstShownRowHeight)) {
if (itemTopOffset + PAGE_ZOOM_ROUNDING_PRECISION_FIX_INCREMENT >= firstShownRowTopOffset + firstShownRowHeight) {
// Next row is detected. Measure inter-row spacing.

@@ -61,3 +61,17 @@ // Can't be "negative" with the current `if` condition.

}
}
} // There's a rounding precision error when a web browser has a non-100% scale
// when viewing a page. I dunno what's the source of the imprecision.
// The thing is: previousRow.top + previousRow.height !== nextRow.top.
// The two parts of the equation above differ by a magnitude of 0.0001.
// To fix that, when performing a `>=` comparison, an additional increment is added.
//
// This value of the increment is set to `0.9px` for no real reason.
// It could be `1px` or `0.99px` and it would most likely work the same way.
// The rationale for the `0.9px` value is that a minimum height of a DOM element
// is assumed to be `1px` so having a value less than `1px` would theoretically be
// less buggy in a way that it wouldn't skip the rows that're `1px` high.
//
var PAGE_ZOOM_ROUNDING_PRECISION_FIX_INCREMENT = 0.9;
//# sourceMappingURL=getVerticalSpacing.js.map

@@ -38,3 +38,3 @@ export default function getVerticalSpacing(_ref) {

if (Math.ceil(itemTopOffset) >= Math.floor(firstShownRowTopOffset) + Math.floor(firstShownRowHeight)) {
if (itemTopOffset + PAGE_ZOOM_ROUNDING_PRECISION_FIX_INCREMENT >= firstShownRowTopOffset + firstShownRowHeight) {
// Next row is detected. Measure inter-row spacing.

@@ -54,3 +54,16 @@ // Can't be "negative" with the current `if` condition.

}
}
} // There's a rounding precision error when a web browser has a non-100% scale
// when viewing a page. I dunno what's the source of the imprecision.
// The thing is: previousRow.top + previousRow.height !== nextRow.top.
// The two parts of the equation above differ by a magnitude of 0.0001.
// To fix that, when performing a `>=` comparison, an additional increment is added.
//
// This value of the increment is set to `0.9px` for no real reason.
// It could be `1px` or `0.99px` and it would most likely work the same way.
// The rationale for the `0.9px` value is that a minimum height of a DOM element
// is assumed to be `1px` so having a value less than `1px` would theoretically be
// less buggy in a way that it wouldn't skip the rows that're `1px` high.
//
var PAGE_ZOOM_ROUNDING_PRECISION_FIX_INCREMENT = 0.9;
//# sourceMappingURL=getVerticalSpacing.js.map

2

package.json
{
"name": "virtual-scroller",
"version": "1.12.5",
"version": "1.12.6",
"description": "A component for efficiently rendering large lists of variable height items",

@@ -5,0 +5,0 @@ "main": "index.cjs",

@@ -36,3 +36,3 @@ export default function getVerticalSpacing({ itemsContainer, renderedItemsCount }) {

//
if (Math.ceil(itemTopOffset) >= Math.floor(firstShownRowTopOffset) + Math.floor(firstShownRowHeight)) {
if (itemTopOffset + PAGE_ZOOM_ROUNDING_PRECISION_FIX_INCREMENT >= firstShownRowTopOffset + firstShownRowHeight) {
// Next row is detected. Measure inter-row spacing.

@@ -53,2 +53,16 @@ // Can't be "negative" with the current `if` condition.

}
}
}
// There's a rounding precision error when a web browser has a non-100% scale
// when viewing a page. I dunno what's the source of the imprecision.
// The thing is: previousRow.top + previousRow.height !== nextRow.top.
// The two parts of the equation above differ by a magnitude of 0.0001.
// To fix that, when performing a `>=` comparison, an additional increment is added.
//
// This value of the increment is set to `0.9px` for no real reason.
// It could be `1px` or `0.99px` and it would most likely work the same way.
// The rationale for the `0.9px` value is that a minimum height of a DOM element
// is assumed to be `1px` so having a value less than `1px` would theoretically be
// less buggy in a way that it wouldn't skip the rows that're `1px` high.
//
const PAGE_ZOOM_ROUNDING_PRECISION_FIX_INCREMENT = 0.9

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc