@vaadin/tooltip 25.2.15 → 25.2.17
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 +12 -12
- package/src/vaadin-tooltip-mixin.js +13 -4
- 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/tooltip",
|
|
3
|
-
"version": "25.2.
|
|
3
|
+
"version": "25.2.17",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -35,20 +35,20 @@
|
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
38
|
-
"@vaadin/a11y-base": "~25.2.
|
|
39
|
-
"@vaadin/component-base": "~25.2.
|
|
40
|
-
"@vaadin/markdown": "~25.2.
|
|
41
|
-
"@vaadin/overlay": "~25.2.
|
|
42
|
-
"@vaadin/popover": "~25.2.
|
|
43
|
-
"@vaadin/vaadin-themable-mixin": "~25.2.
|
|
38
|
+
"@vaadin/a11y-base": "~25.2.17",
|
|
39
|
+
"@vaadin/component-base": "~25.2.17",
|
|
40
|
+
"@vaadin/markdown": "~25.2.17",
|
|
41
|
+
"@vaadin/overlay": "~25.2.17",
|
|
42
|
+
"@vaadin/popover": "~25.2.17",
|
|
43
|
+
"@vaadin/vaadin-themable-mixin": "~25.2.17",
|
|
44
44
|
"lit": "^3.0.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@vaadin/aura": "~25.2.
|
|
48
|
-
"@vaadin/chai-plugins": "~25.2.
|
|
49
|
-
"@vaadin/test-runner-commands": "~25.2.
|
|
47
|
+
"@vaadin/aura": "~25.2.17",
|
|
48
|
+
"@vaadin/chai-plugins": "~25.2.17",
|
|
49
|
+
"@vaadin/test-runner-commands": "~25.2.17",
|
|
50
50
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
51
|
-
"@vaadin/vaadin-lumo-styles": "~25.2.
|
|
51
|
+
"@vaadin/vaadin-lumo-styles": "~25.2.17",
|
|
52
52
|
"sinon": "^22.0.0"
|
|
53
53
|
},
|
|
54
54
|
"customElements": "custom-elements.json",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"web-types.json",
|
|
57
57
|
"web-types.lit.json"
|
|
58
58
|
],
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "089949baaf209424c9bfec1f36d79c3efaa8b8d9"
|
|
60
60
|
}
|
|
@@ -20,6 +20,8 @@ const closing = new Set();
|
|
|
20
20
|
|
|
21
21
|
let warmedUp = false;
|
|
22
22
|
let warmUpTimeout = null;
|
|
23
|
+
/** The tooltip that opens when the warm up timeout ends. */
|
|
24
|
+
let warmUpTooltip = null;
|
|
23
25
|
let cooldownTimeout = null;
|
|
24
26
|
|
|
25
27
|
/**
|
|
@@ -32,6 +34,7 @@ export function resetGlobalTooltipState() {
|
|
|
32
34
|
clearTimeout(warmUpTimeout);
|
|
33
35
|
clearTimeout(cooldownTimeout);
|
|
34
36
|
warmUpTimeout = null;
|
|
37
|
+
warmUpTooltip = null;
|
|
35
38
|
cooldownTimeout = null;
|
|
36
39
|
closing.clear();
|
|
37
40
|
}
|
|
@@ -144,8 +147,9 @@ class TooltipStateController {
|
|
|
144
147
|
if (warmedUp) {
|
|
145
148
|
// Warmed up, show the tooltip.
|
|
146
149
|
this.__showTooltip();
|
|
147
|
-
} else if (warmUpTimeout == null) {
|
|
148
|
-
// Ensure there is no duplicate warm up.
|
|
150
|
+
} else if (warmUpTimeout == null || !warmUpTooltip.isConnected) {
|
|
151
|
+
// Ensure there is no duplicate warm up, unless its tooltip was removed.
|
|
152
|
+
this.__abortWarmUp();
|
|
149
153
|
this.__scheduleWarmUp(isFocus);
|
|
150
154
|
}
|
|
151
155
|
}
|
|
@@ -177,6 +181,7 @@ class TooltipStateController {
|
|
|
177
181
|
if (warmUpTimeout) {
|
|
178
182
|
clearTimeout(warmUpTimeout);
|
|
179
183
|
warmUpTimeout = null;
|
|
184
|
+
warmUpTooltip = null;
|
|
180
185
|
}
|
|
181
186
|
}
|
|
182
187
|
|
|
@@ -206,10 +211,14 @@ class TooltipStateController {
|
|
|
206
211
|
/** @private */
|
|
207
212
|
__scheduleWarmUp(isFocus) {
|
|
208
213
|
const delay = isFocus ? this.focusDelay : this.hoverDelay;
|
|
214
|
+
warmUpTooltip = this.host;
|
|
209
215
|
warmUpTimeout = setTimeout(() => {
|
|
210
216
|
warmUpTimeout = null;
|
|
211
|
-
|
|
212
|
-
|
|
217
|
+
warmUpTooltip = null;
|
|
218
|
+
// Do not open a tooltip that was removed while waiting.
|
|
219
|
+
if (this.host.isConnected) {
|
|
220
|
+
this.__showTooltip();
|
|
221
|
+
}
|
|
213
222
|
}, delay);
|
|
214
223
|
}
|
|
215
224
|
}
|
package/web-types.json
CHANGED