@@ -56,13 +56,21 @@ const BALLOON_CLASS = 'ck-tooltip';
56
56
*
57
57
* # Disabling tooltips
58
58
*
59
- * In order to disable the tooltip temporarily, use the `data-cke-tooltip-disabled` attribute:
59
+ * In order to disable the tooltip temporarily, use the `data-cke-tooltip-disabled` attribute:
60
60
*
61
61
* ```ts
62
62
* domElement.dataset.ckeTooltipText = 'Disabled. For now.';
63
63
* domElement.dataset.ckeTooltipDisabled = 'true';
64
64
* ```
65
65
*
66
+ * # Instant tooltips
67
+ *
68
+ * To remove the delay before showing or hiding the tooltip, use the `data-cke-tooltip-instant` attribute:
69
+ *
70
+ * ```ts
71
+ * domElement.dataset.ckeTooltipInstant = 'true';
72
+ * ```
73
+ *
66
74
* # Styling tooltips
67
75
*
68
76
* By default, the tooltip has `.ck-tooltip` class and its text inner `.ck-tooltip__text`.
@@ -304,12 +312,12 @@ export default class TooltipManager extends /* #__PURE__ */ DomEmitterMixin() {
304
312
// The tooltip should be pinned immediately when the element gets focused using keyboard.
305
313
// If it is focused using the mouse, the tooltip should be pinned after a delay to prevent flashing.
306
314
// See https://github.com/ckeditor/ckeditor5/issues/16383
307
- // Also, if the element has a class `ck-with-instant- tooltip`, the tooltip should be pinned immediately.
315
+ // Also, if the element has an attribute `data-cke- tooltip-instant `, the tooltip should be pinned immediately.
308
316
// This is useful for elements that have their content partially hidden (e.g. a long text in a small container)
309
317
// and should show a tooltip on hover, like merge field.
310
- if (
318
+ if (
311
319
evt . name === 'focus' && ! elementWithTooltipAttribute . matches ( ':hover' ) ||
312
- elementWithTooltipAttribute . matches ( '.ck-with-instant- tooltip' )
320
+ elementWithTooltipAttribute . matches ( '[data-cke- tooltip-instant] ' )
313
321
) {
314
322
this . _pinTooltip ( elementWithTooltipAttribute , getTooltipData ( elementWithTooltipAttribute ) ) ;
315
323
} else {
@@ -337,6 +345,7 @@ export default class TooltipManager extends /* #__PURE__ */ DomEmitterMixin() {
337
345
// Do not hide the tooltip when the user moves the cursor over it.
338
346
if ( isEnteringBalloon ) {
339
347
this . _unpinTooltipDebounced . cancel ( ) ;
348
+
340
349
return ;
341
350
}
342
351
0 commit comments