@vaadin/virtual-list 23.5.10 → 23.5.12

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": "23.5.10",
3
+ "version": "23.5.12",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -38,15 +38,15 @@
38
38
  ],
39
39
  "dependencies": {
40
40
  "@polymer/polymer": "^3.0.0",
41
- "@vaadin/component-base": "~23.5.10",
42
- "@vaadin/lit-renderer": "~23.5.10",
43
- "@vaadin/vaadin-lumo-styles": "~23.5.10",
44
- "@vaadin/vaadin-material-styles": "~23.5.10",
45
- "@vaadin/vaadin-themable-mixin": "~23.5.10"
41
+ "@vaadin/component-base": "~23.5.12",
42
+ "@vaadin/lit-renderer": "~23.5.12",
43
+ "@vaadin/vaadin-lumo-styles": "~23.5.12",
44
+ "@vaadin/vaadin-material-styles": "~23.5.12",
45
+ "@vaadin/vaadin-themable-mixin": "~23.5.12"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@esm-bundle/chai": "^4.3.4",
49
- "@vaadin/polymer-legacy-adapter": "~23.5.10",
49
+ "@vaadin/polymer-legacy-adapter": "~23.5.12",
50
50
  "@vaadin/testing-helpers": "^0.3.2",
51
51
  "lit": "^2.0.0",
52
52
  "sinon": "^13.0.2"
@@ -55,5 +55,5 @@
55
55
  "web-types.json",
56
56
  "web-types.lit.json"
57
57
  ],
58
- "gitHead": "252e905e8d87bc4d4a1d6b8a60201b66bea70ba5"
58
+ "gitHead": "649d4656babb0403813ce4f797e1fc4484b0dd11"
59
59
  }
@@ -112,7 +112,7 @@ class VirtualList extends ElementMixin(ControllerMixin(ThemableMixin(PolymerElem
112
112
 
113
113
  constructor() {
114
114
  super();
115
- this.__onDragStart = this.__onDragStart.bind(this);
115
+ this.__onDocumentDragStart = this.__onDocumentDragStart.bind(this);
116
116
  }
117
117
 
118
118
  /** @protected */
@@ -136,17 +136,13 @@ class VirtualList extends ElementMixin(ControllerMixin(ThemableMixin(PolymerElem
136
136
  /** @protected */
137
137
  connectedCallback() {
138
138
  super.connectedCallback();
139
- // Chromium based browsers cannot properly generate drag images for elements
140
- // that have children with massive heights. This workaround prevents crashes
141
- // and performance issues by excluding the items from the drag image.
142
- // https://github.com/vaadin/web-components/issues/7985
143
- document.addEventListener('dragstart', this.__onDragStart, { capture: true });
139
+ document.addEventListener('dragstart', this.__onDocumentDragStart, { capture: true });
144
140
  }
145
141
 
146
142
  /** @protected */
147
143
  disconnectedCallback() {
148
144
  super.disconnectedCallback();
149
- document.removeEventListener('dragstart', this.__onDragStart, { capture: true });
145
+ document.removeEventListener('dragstart', this.__onDocumentDragStart, { capture: true });
150
146
  }
151
147
 
152
148
  /**
@@ -200,25 +196,24 @@ class VirtualList extends ElementMixin(ControllerMixin(ThemableMixin(PolymerElem
200
196
  }
201
197
  }
202
198
 
203
- /** @private */
204
- __onDragStart(e) {
205
- // The dragged element can be the element itself or a parent of the element
206
- if (!e.target.contains(this)) {
207
- return;
208
- }
209
- // The threshold value 20000 provides a buffer to both
210
- // - avoid the crash and the performance issues
211
- // - unnecessarily avoid excluding items from the drag image
212
- if (this.$.items.offsetHeight > 20000) {
213
- const initialItemsMaxHeight = this.$.items.style.maxHeight;
214
- const initialVirtualListOverflow = this.style.overflow;
215
- // Momentarily hides the items until the browser starts generating the
216
- // drag image.
217
- this.$.items.style.maxHeight = '0';
218
- this.style.overflow = 'hidden';
199
+ /**
200
+ * Webkit-based browsers have issues with generating drag images
201
+ * for elements that have children with massive heights. Chromium
202
+ * browsers crash, while Safari experiences significant performance
203
+ * issues. To mitigate these issues, we hide the items container
204
+ * when drag starts to remove it from the drag image.
205
+ *
206
+ * Related issues:
207
+ * - https://github.com/vaadin/web-components/issues/7985
208
+ * - https://issues.chromium.org/issues/383356871
209
+ *
210
+ * @private
211
+ */
212
+ __onDocumentDragStart(e) {
213
+ if (e.target.contains(this) && this.scrollHeight > 20000) {
214
+ this.$.items.style.display = 'none';
219
215
  requestAnimationFrame(() => {
220
- this.$.items.style.maxHeight = initialItemsMaxHeight;
221
- this.style.overflow = initialVirtualListOverflow;
216
+ this.$.items.style.display = '';
222
217
  });
223
218
  }
224
219
  }
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": "23.5.10",
4
+ "version": "23.5.12",
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": "23.5.10",
4
+ "version": "23.5.12",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {