question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The data-bs-delay='{"show": 500}' kills the tooltip style

See original GitHub issue

Hi, I have recently updated from Bootstrap 4.6.x to 5.1.1. for my web-site www.uvvo.club When migrating I have changed data-* to data-bs-*, including change data-delay='{"show": 500}' to data-bs-delay='{"show": 500}' With this line, the appearance of a tooltip is delayed for a half a second, however the style of the tooltip becomes just a grey box with text. with data-delay='500' it works fine, but I want the tooltip to disappear immediately after moving the mouse away.

OS: Windows 10 Browser: MS Edge Bootstrap v.5.1.1 is used via via jsDelivr

In the developer tools of the browser I get also:

jquery.min.js:2 Uncaught TypeError: TOOLTIP: Option “delay” provided type “string” but expected type “(number|object)”. at index.js:134 at Array.forEach (<anonymous>) at r (index.js:128) at Ye._getConfig (tooltip.js:680) at new Ye (tooltip.js:142) at profile?id=5f22c0c45c2e592e90429dfc:62 at Array.map (<anonymous>) at HTMLDocument.<anonymous> (profile?id=5f22c0c45c2e592e90429dfc:61) at e (jquery.min.js:2) at t (jquery.min.js:2)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ereatorcommented, Oct 1, 2021

@GeoSot thank you for the hint. Following your advise, I’ve added the following code to my layout file:

$(function () {
    const config = {
        delay: {
        show : 500
        }
    }                
    var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
    var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
        return new bootstrap.Tooltip(tooltipTriggerEl, config)
    });
});

which delays all the tooltips on the page and works fine. I do not know the best way, how to delay only some of the tooltips and leave other tooltips to appear immediately.

0reactions
jonnybradleycommented, Apr 11, 2022

I know there’s a comprehensive looking PR (#35077 thanks @GeoSot) to address this regression but i thought i’d make a codepen to demonstrate cleanly, which is here:

https://codepen.io/jonnybradley/pen/yLpqLbP

Note that this worked fine in bootstrap 3 and 4 but presumably then jQuery was doing the JSON parsing for us?

Meanwhile i guess we’ll work round it…

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found