@vaadin/virtual-list 24.6.2 → 24.6.4
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 +9 -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.6.
|
|
3
|
+
"version": "24.6.4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -39,15 +39,16 @@
|
|
|
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.
|
|
43
|
-
"@vaadin/lit-renderer": "~24.6.
|
|
44
|
-
"@vaadin/vaadin-lumo-styles": "~24.6.
|
|
45
|
-
"@vaadin/vaadin-material-styles": "~24.6.
|
|
46
|
-
"@vaadin/vaadin-themable-mixin": "~24.6.
|
|
42
|
+
"@vaadin/component-base": "~24.6.4",
|
|
43
|
+
"@vaadin/lit-renderer": "~24.6.4",
|
|
44
|
+
"@vaadin/vaadin-lumo-styles": "~24.6.4",
|
|
45
|
+
"@vaadin/vaadin-material-styles": "~24.6.4",
|
|
46
|
+
"@vaadin/vaadin-themable-mixin": "~24.6.4",
|
|
47
47
|
"lit": "^3.0.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@vaadin/chai-plugins": "~24.6.
|
|
50
|
+
"@vaadin/chai-plugins": "~24.6.4",
|
|
51
|
+
"@vaadin/test-runner-commands": "~24.6.4",
|
|
51
52
|
"@vaadin/testing-helpers": "^1.1.0",
|
|
52
53
|
"sinon": "^18.0.0"
|
|
53
54
|
},
|
|
@@ -55,5 +56,5 @@
|
|
|
55
56
|
"web-types.json",
|
|
56
57
|
"web-types.lit.json"
|
|
57
58
|
],
|
|
58
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "02d8ac2c39bc2d27fe60acec7d7bac6bdb73d8a1"
|
|
59
60
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Copyright (c) 2021 - 2024 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';
|
|
@@ -156,17 +157,43 @@ export const VirtualListMixin = (superClass) =>
|
|
|
156
157
|
* issues. To mitigate these issues, we hide the items container
|
|
157
158
|
* when drag starts to remove it from the drag image.
|
|
158
159
|
*
|
|
160
|
+
* Virtual lists with fewer rows also have issues on Chromium and Safari
|
|
161
|
+
* where the drag image is not properly clipped and may include
|
|
162
|
+
* content outside the virtual list. Temporary inline styles are applied
|
|
163
|
+
* to mitigate this issue.
|
|
164
|
+
*
|
|
159
165
|
* Related issues:
|
|
160
166
|
* - https://github.com/vaadin/web-components/issues/7985
|
|
161
167
|
* - https://issues.chromium.org/issues/383356871
|
|
168
|
+
* - https://github.com/vaadin/web-components/issues/8386
|
|
162
169
|
*
|
|
163
170
|
* @private
|
|
164
171
|
*/
|
|
165
172
|
__onDocumentDragStart(e) {
|
|
166
|
-
if (e.target.contains(this)
|
|
167
|
-
|
|
173
|
+
if (e.target.contains(this)) {
|
|
174
|
+
// Record the original inline styles to restore them later
|
|
175
|
+
const elements = [e.target, this.$.items];
|
|
176
|
+
const originalInlineStyles = elements.map((element) => element.style.cssText);
|
|
177
|
+
|
|
178
|
+
// With a large number of rows, hide the items
|
|
179
|
+
if (this.scrollHeight > 20000) {
|
|
180
|
+
this.$.items.style.display = 'none';
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// Workaround content outside the virtual list ending up in the drag image on Chromium
|
|
184
|
+
if (isChrome) {
|
|
185
|
+
e.target.style.willChange = 'transform';
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// Workaround text content outside the virtual list ending up in the drag image on Safari
|
|
189
|
+
if (isSafari) {
|
|
190
|
+
this.$.items.style.maxHeight = '100%';
|
|
191
|
+
}
|
|
192
|
+
|
|
168
193
|
requestAnimationFrame(() => {
|
|
169
|
-
|
|
194
|
+
elements.forEach((element, index) => {
|
|
195
|
+
element.style.cssText = originalInlineStyles[index];
|
|
196
|
+
});
|
|
170
197
|
});
|
|
171
198
|
}
|
|
172
199
|
}
|
package/web-types.json
CHANGED