@vaadin/virtual-list 24.7.0-alpha5 → 24.7.0-alpha7
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 +8 -8
- package/src/vaadin-virtual-list-mixin.js +30 -3
- package/web-types.json +1 -1
- package/web-types.lit.json +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/virtual-list",
|
|
3
|
-
"version": "24.7.0-
|
|
3
|
+
"version": "24.7.0-alpha7",
|
|
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-
|
|
43
|
-
"@vaadin/lit-renderer": "24.7.0-
|
|
44
|
-
"@vaadin/vaadin-lumo-styles": "24.7.0-
|
|
45
|
-
"@vaadin/vaadin-material-styles": "24.7.0-
|
|
46
|
-
"@vaadin/vaadin-themable-mixin": "24.7.0-
|
|
42
|
+
"@vaadin/component-base": "24.7.0-alpha7",
|
|
43
|
+
"@vaadin/lit-renderer": "24.7.0-alpha7",
|
|
44
|
+
"@vaadin/vaadin-lumo-styles": "24.7.0-alpha7",
|
|
45
|
+
"@vaadin/vaadin-material-styles": "24.7.0-alpha7",
|
|
46
|
+
"@vaadin/vaadin-themable-mixin": "24.7.0-alpha7",
|
|
47
47
|
"lit": "^3.0.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@vaadin/chai-plugins": "24.7.0-
|
|
50
|
+
"@vaadin/chai-plugins": "24.7.0-alpha7",
|
|
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": "
|
|
58
|
+
"gitHead": "5f48d7024caa02773aff3aa53091326a42d1eeb1"
|
|
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)
|
|
196
|
-
|
|
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
|
-
|
|
223
|
+
elements.forEach((element, index) => {
|
|
224
|
+
element.style.cssText = originalInlineStyles[index];
|
|
225
|
+
});
|
|
199
226
|
});
|
|
200
227
|
}
|
|
201
228
|
}
|
package/web-types.json
CHANGED
package/web-types.lit.json
CHANGED