@vaadin/overlay 24.9.0-beta1 → 24.9.0-rc1
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 -9
- package/src/vaadin-overlay-utils.js +11 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/overlay",
|
|
3
|
-
"version": "24.9.0-
|
|
3
|
+
"version": "24.9.0-rc1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -36,18 +36,18 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
38
38
|
"@polymer/polymer": "^3.0.0",
|
|
39
|
-
"@vaadin/a11y-base": "24.9.0-
|
|
40
|
-
"@vaadin/component-base": "24.9.0-
|
|
41
|
-
"@vaadin/vaadin-lumo-styles": "24.9.0-
|
|
42
|
-
"@vaadin/vaadin-material-styles": "24.9.0-
|
|
43
|
-
"@vaadin/vaadin-themable-mixin": "24.9.0-
|
|
39
|
+
"@vaadin/a11y-base": "24.9.0-rc1",
|
|
40
|
+
"@vaadin/component-base": "24.9.0-rc1",
|
|
41
|
+
"@vaadin/vaadin-lumo-styles": "24.9.0-rc1",
|
|
42
|
+
"@vaadin/vaadin-material-styles": "24.9.0-rc1",
|
|
43
|
+
"@vaadin/vaadin-themable-mixin": "24.9.0-rc1",
|
|
44
44
|
"lit": "^3.0.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@vaadin/chai-plugins": "24.9.0-
|
|
48
|
-
"@vaadin/test-runner-commands": "24.9.0-
|
|
47
|
+
"@vaadin/chai-plugins": "24.9.0-rc1",
|
|
48
|
+
"@vaadin/test-runner-commands": "24.9.0-rc1",
|
|
49
49
|
"@vaadin/testing-helpers": "^1.1.0",
|
|
50
50
|
"sinon": "^18.0.0"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "cfe9424405716297d9f1eee425d5a059b2f636f8"
|
|
53
53
|
}
|
|
@@ -16,10 +16,12 @@
|
|
|
16
16
|
*/
|
|
17
17
|
export function observeMove(element, callback) {
|
|
18
18
|
let io = null;
|
|
19
|
+
let timeout;
|
|
19
20
|
|
|
20
21
|
const root = document.documentElement;
|
|
21
22
|
|
|
22
23
|
function cleanup() {
|
|
24
|
+
timeout && clearTimeout(timeout);
|
|
23
25
|
io && io.disconnect();
|
|
24
26
|
io = null;
|
|
25
27
|
}
|
|
@@ -52,27 +54,22 @@ export function observeMove(element, callback) {
|
|
|
52
54
|
let isFirstUpdate = true;
|
|
53
55
|
|
|
54
56
|
function handleObserve(entries) {
|
|
55
|
-
|
|
57
|
+
const ratio = entries[0].intersectionRatio;
|
|
56
58
|
|
|
57
59
|
if (ratio !== threshold) {
|
|
58
60
|
if (!isFirstUpdate) {
|
|
59
61
|
return refresh();
|
|
60
62
|
}
|
|
61
63
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
// moves beneath _that_ new value, the user will get notified.
|
|
71
|
-
if (ratio === 0.0) {
|
|
72
|
-
ratio = 0.0000001; // Just needs to be non-zero
|
|
64
|
+
if (!ratio) {
|
|
65
|
+
// If the reference is clipped, the ratio is 0. Throttle the refresh
|
|
66
|
+
// to prevent an infinite loop of updates.
|
|
67
|
+
timeout = setTimeout(() => {
|
|
68
|
+
refresh(false, 1e-7);
|
|
69
|
+
}, 1000);
|
|
70
|
+
} else {
|
|
71
|
+
refresh(false, ratio);
|
|
73
72
|
}
|
|
74
|
-
|
|
75
|
-
refresh(false, ratio);
|
|
76
73
|
}
|
|
77
74
|
|
|
78
75
|
isFirstUpdate = false;
|