@vaadin/virtual-list 24.7.0-alpha4 → 24.7.0-alpha6

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.7.0-alpha4",
3
+ "version": "24.7.0-alpha6",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -39,15 +39,15 @@
39
39
  "dependencies": {
40
40
  "@open-wc/dedupe-mixin": "^1.3.0",
41
41
  "@polymer/polymer": "^3.0.0",
42
- "@vaadin/component-base": "24.7.0-alpha4",
43
- "@vaadin/lit-renderer": "24.7.0-alpha4",
44
- "@vaadin/vaadin-lumo-styles": "24.7.0-alpha4",
45
- "@vaadin/vaadin-material-styles": "24.7.0-alpha4",
46
- "@vaadin/vaadin-themable-mixin": "24.7.0-alpha4",
42
+ "@vaadin/component-base": "24.7.0-alpha6",
43
+ "@vaadin/lit-renderer": "24.7.0-alpha6",
44
+ "@vaadin/vaadin-lumo-styles": "24.7.0-alpha6",
45
+ "@vaadin/vaadin-material-styles": "24.7.0-alpha6",
46
+ "@vaadin/vaadin-themable-mixin": "24.7.0-alpha6",
47
47
  "lit": "^3.0.0"
48
48
  },
49
49
  "devDependencies": {
50
- "@vaadin/chai-plugins": "24.7.0-alpha4",
50
+ "@vaadin/chai-plugins": "24.7.0-alpha6",
51
51
  "@vaadin/testing-helpers": "^1.1.0",
52
52
  "sinon": "^18.0.0"
53
53
  },
@@ -55,5 +55,5 @@
55
55
  "web-types.json",
56
56
  "web-types.lit.json"
57
57
  ],
58
- "gitHead": "d7165cebf9dcf6a7e9e22f6353662d33404b4856"
58
+ "gitHead": "6255a512997a648da91fed37de4d5000809eaebf"
59
59
  }
@@ -3,6 +3,7 @@
3
3
  * Copyright (c) 2021 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
+ import { isChrome, isSafari } from '@vaadin/component-base/src/browser-utils.js';
6
7
  import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
7
8
  import { OverflowController } from '@vaadin/component-base/src/overflow-controller.js';
8
9
  import { processTemplates } from '@vaadin/component-base/src/templates.js';
@@ -185,17 +186,43 @@ export const VirtualListMixin = (superClass) =>
185
186
  * issues. To mitigate these issues, we hide the items container
186
187
  * when drag starts to remove it from the drag image.
187
188
  *
189
+ * Virtual lists with fewer rows also have issues on Chromium and Safari
190
+ * where the drag image is not properly clipped and may include
191
+ * content outside the virtual list. Temporary inline styles are applied
192
+ * to mitigate this issue.
193
+ *
188
194
  * Related issues:
189
195
  * - https://github.com/vaadin/web-components/issues/7985
190
196
  * - https://issues.chromium.org/issues/383356871
197
+ * - https://github.com/vaadin/web-components/issues/8386
191
198
  *
192
199
  * @private
193
200
  */
194
201
  __onDocumentDragStart(e) {
195
- if (e.target.contains(this) && this.scrollHeight > 20000) {
196
- this.$.items.style.display = 'none';
202
+ if (e.target.contains(this)) {
203
+ // Record the original inline styles to restore them later
204
+ const elements = [e.target, this.$.items];
205
+ const originalInlineStyles = elements.map((element) => element.style.cssText);
206
+
207
+ // With a large number of rows, hide the items
208
+ if (this.scrollHeight > 20000) {
209
+ this.$.items.style.display = 'none';
210
+ }
211
+
212
+ // Workaround content outside the virtual list ending up in the drag image on Chromium
213
+ if (isChrome) {
214
+ e.target.style.willChange = 'transform';
215
+ }
216
+
217
+ // Workaround text content outside the virtual list ending up in the drag image on Safari
218
+ if (isSafari) {
219
+ this.$.items.style.maxHeight = '100%';
220
+ }
221
+
197
222
  requestAnimationFrame(() => {
198
- this.$.items.style.display = '';
223
+ elements.forEach((element, index) => {
224
+ element.style.cssText = originalInlineStyles[index];
225
+ });
199
226
  });
200
227
  }
201
228
  }
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.7.0-alpha4",
4
+ "version": "24.7.0-alpha6",
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.7.0-alpha4",
4
+ "version": "24.7.0-alpha6",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {