@vaadin/virtual-list 24.6.0 → 24.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/virtual-list",
3
- "version": "24.6.0",
3
+ "version": "24.6.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -39,21 +39,21 @@
39
39
  "dependencies": {
40
40
  "@open-wc/dedupe-mixin": "^1.3.0",
41
41
  "@polymer/polymer": "^3.0.0",
42
- "@vaadin/component-base": "~24.6.0",
43
- "@vaadin/lit-renderer": "~24.6.0",
44
- "@vaadin/vaadin-lumo-styles": "~24.6.0",
45
- "@vaadin/vaadin-material-styles": "~24.6.0",
46
- "@vaadin/vaadin-themable-mixin": "~24.6.0",
42
+ "@vaadin/component-base": "~24.6.2",
43
+ "@vaadin/lit-renderer": "~24.6.2",
44
+ "@vaadin/vaadin-lumo-styles": "~24.6.2",
45
+ "@vaadin/vaadin-material-styles": "~24.6.2",
46
+ "@vaadin/vaadin-themable-mixin": "~24.6.2",
47
47
  "lit": "^3.0.0"
48
48
  },
49
49
  "devDependencies": {
50
- "@vaadin/chai-plugins": "~24.6.0",
51
- "@vaadin/testing-helpers": "^1.0.0",
50
+ "@vaadin/chai-plugins": "~24.6.2",
51
+ "@vaadin/testing-helpers": "^1.1.0",
52
52
  "sinon": "^18.0.0"
53
53
  },
54
54
  "web-types": [
55
55
  "web-types.json",
56
56
  "web-types.lit.json"
57
57
  ],
58
- "gitHead": "c0b38aa981494d04fac64da35aa3890ad72551ea"
58
+ "gitHead": "ee2ea01a17d888403adb141515a0a3cef82b8b65"
59
59
  }
@@ -65,7 +65,7 @@ export const VirtualListMixin = (superClass) =>
65
65
 
66
66
  constructor() {
67
67
  super();
68
- this.__onDragStart = this.__onDragStart.bind(this);
68
+ this.__onDocumentDragStart = this.__onDocumentDragStart.bind(this);
69
69
  }
70
70
 
71
71
  /** @protected */
@@ -89,17 +89,13 @@ export const VirtualListMixin = (superClass) =>
89
89
  /** @protected */
90
90
  connectedCallback() {
91
91
  super.connectedCallback();
92
- // Chromium based browsers cannot properly generate drag images for elements
93
- // that have children with massive heights. This workaround prevents crashes
94
- // and performance issues by excluding the items from the drag image.
95
- // https://github.com/vaadin/web-components/issues/7985
96
- document.addEventListener('dragstart', this.__onDragStart, { capture: true });
92
+ document.addEventListener('dragstart', this.__onDocumentDragStart, { capture: true });
97
93
  }
98
94
 
99
95
  /** @protected */
100
96
  disconnectedCallback() {
101
97
  super.disconnectedCallback();
102
- document.removeEventListener('dragstart', this.__onDragStart, { capture: true });
98
+ document.removeEventListener('dragstart', this.__onDocumentDragStart, { capture: true });
103
99
  }
104
100
 
105
101
  /**
@@ -153,25 +149,24 @@ export const VirtualListMixin = (superClass) =>
153
149
  }
154
150
  }
155
151
 
156
- /** @private */
157
- __onDragStart(e) {
158
- // The dragged element can be the element itself or a parent of the element
159
- if (!e.target.contains(this)) {
160
- return;
161
- }
162
- // The threshold value 20000 provides a buffer to both
163
- // - avoid the crash and the performance issues
164
- // - unnecessarily avoid excluding items from the drag image
165
- if (this.$.items.offsetHeight > 20000) {
166
- const initialItemsMaxHeight = this.$.items.style.maxHeight;
167
- const initialVirtualListOverflow = this.style.overflow;
168
- // Momentarily hides the items until the browser starts generating the
169
- // drag image.
170
- this.$.items.style.maxHeight = '0';
171
- this.style.overflow = 'hidden';
152
+ /**
153
+ * Webkit-based browsers have issues with generating drag images
154
+ * for elements that have children with massive heights. Chromium
155
+ * browsers crash, while Safari experiences significant performance
156
+ * issues. To mitigate these issues, we hide the items container
157
+ * when drag starts to remove it from the drag image.
158
+ *
159
+ * Related issues:
160
+ * - https://github.com/vaadin/web-components/issues/7985
161
+ * - https://issues.chromium.org/issues/383356871
162
+ *
163
+ * @private
164
+ */
165
+ __onDocumentDragStart(e) {
166
+ if (e.target.contains(this) && this.scrollHeight > 20000) {
167
+ this.$.items.style.display = 'none';
172
168
  requestAnimationFrame(() => {
173
- this.$.items.style.maxHeight = initialItemsMaxHeight;
174
- this.style.overflow = initialVirtualListOverflow;
169
+ this.$.items.style.display = '';
175
170
  });
176
171
  }
177
172
  }
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/virtual-list",
4
- "version": "24.6.0",
4
+ "version": "24.6.2",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/virtual-list",
4
- "version": "24.6.0",
4
+ "version": "24.6.2",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {