Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@vaadin/virtual-list

Package Overview
Dependencies
Maintainers
0
Versions
404
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vaadin/virtual-list - npm Package Compare versions

Comparing version 24.6.0-alpha4 to 24.6.0-alpha5

16

package.json
{
"name": "@vaadin/virtual-list",
"version": "24.6.0-alpha4",
"version": "24.6.0-alpha5",
"publishConfig": {

@@ -44,11 +44,11 @@ "access": "public"

"@polymer/polymer": "^3.0.0",
"@vaadin/component-base": "24.6.0-alpha4",
"@vaadin/lit-renderer": "24.6.0-alpha4",
"@vaadin/vaadin-lumo-styles": "24.6.0-alpha4",
"@vaadin/vaadin-material-styles": "24.6.0-alpha4",
"@vaadin/vaadin-themable-mixin": "24.6.0-alpha4",
"@vaadin/component-base": "24.6.0-alpha5",
"@vaadin/lit-renderer": "24.6.0-alpha5",
"@vaadin/vaadin-lumo-styles": "24.6.0-alpha5",
"@vaadin/vaadin-material-styles": "24.6.0-alpha5",
"@vaadin/vaadin-themable-mixin": "24.6.0-alpha5",
"lit": "^3.0.0"
},
"devDependencies": {
"@vaadin/chai-plugins": "24.6.0-alpha4",
"@vaadin/chai-plugins": "24.6.0-alpha5",
"@vaadin/testing-helpers": "^1.0.0",

@@ -61,3 +61,3 @@ "sinon": "^18.0.0"

],
"gitHead": "78967d4f3bb46f58f43c2cc621802554acb2efaf"
"gitHead": "cbfa46fe276f254dcaa99a622710d56df7f0a539"
}

@@ -66,2 +66,7 @@ /**

constructor() {
super();
this.__onDragStart = this.__onDragStart.bind(this);
}
/** @protected */

@@ -79,3 +84,2 @@ ready() {

});
this.__overflowController = new OverflowController(this);

@@ -87,2 +91,18 @@ this.addController(this.__overflowController);

/** @protected */
connectedCallback() {
super.connectedCallback();
// Chromium based browsers cannot properly generate drag images for elements
// that have children with massive heights. This workaround prevents crashes
// and performance issues by excluding the items from the drag image.
// https://github.com/vaadin/web-components/issues/7985
document.addEventListener('dragstart', this.__onDragStart, { capture: true });
}
/** @protected */
disconnectedCallback() {
super.disconnectedCallback();
document.removeEventListener('dragstart', this.__onDragStart, { capture: true });
}
/**

@@ -139,2 +159,25 @@ * Scroll to a specific index in the virtual list.

/** @private */
__onDragStart(e) {
// The dragged element can be the element itself or a parent of the element
if (!e.target.contains(this)) {
return;
}
// The threshold value 20000 provides a buffer to both
// - avoid the crash and the performance issues
// - unnecessarily avoid excluding items from the drag image
if (this.$.items.offsetHeight > 20000) {
const initialItemsMaxHeight = this.$.items.style.maxHeight;
const initialVirtualListOverflow = this.style.overflow;
// Momentarily hides the items until the browser starts generating the
// drag image.
this.$.items.style.maxHeight = '0';
this.style.overflow = 'hidden';
requestAnimationFrame(() => {
this.$.items.style.maxHeight = initialItemsMaxHeight;
this.style.overflow = initialVirtualListOverflow;
});
}
}
/**

@@ -141,0 +184,0 @@ * Requests an update for the content of the rows.

{
"$schema": "https://json.schemastore.org/web-types",
"name": "@vaadin/virtual-list",
"version": "24.6.0-alpha4",
"version": "24.6.0-alpha5",
"description-markup": "markdown",

@@ -6,0 +6,0 @@ "contributions": {

{
"$schema": "https://json.schemastore.org/web-types",
"name": "@vaadin/virtual-list",
"version": "24.6.0-alpha4",
"version": "24.6.0-alpha5",
"description-markup": "markdown",

@@ -6,0 +6,0 @@ "framework": "lit",

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc