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.

I am trying to get the tooltip to work but nothing is showing up.

I used the code you have in the demo with the following scripts

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
  <script src="//cdnjs.cloudflare.com/ajax/libs/tether/1.3.2/js/tether.min.js"></script>
    <script src="https://cdn.rawgit.com/twbs/bootstrap/v4-dev/dist/js/bootstrap.js"></script>
    <script>
      $(document).ready(function() {
        $('[data-toggle="tooltip"]').tooltip();
      });
    </script>

Inside the CalendarHeatmap component, I added these props

          titleForValue={customTitleForValue}
          tooltipDataAttrs={customTooltipDataAttrs}

with the functions from your demo

const customTooltipDataAttrs = { 'data-toggle': 'tooltip' };
function customTitleForValue(value) {
  return value ? `You're hovering over ${value.date} with value ${value.count}` : null;
}

I do not see any error too, so I am not sure what the problem is… The calendar is working itself showing the colored squares and when I click on it, it shows the count so that is fine.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:4
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

8reactions
atkawa7commented, Sep 15, 2017

I had the same problem. Ended up using https://github.com/wwayne/react-tooltip. Something like this

const customTooltipDataAttrs = (value) => ({'data-tip': this.valueToString(value)});

Note: I called <CalendarHeatmap> before <ReactTooltip/>

7reactions
isaacnasscommented, Feb 9, 2018

as an addendum to @atkawa7 if you’re pulling records asynchronously to put in the heatmap make sure to either render the heatmap with the tooltip conditionally or call ReactTooltip.rebuild() after you fetch the data to rebind the tooltips!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bootstrap tooltips not working - Stack Overflow
Bootstrap tooltips are expensive because you need to handle mouse events on each of the elements. This is the reason why they haven't...
Read more >
Problem with hover tooltips · Issue #36253 · twbs/bootstrap
When you hover over an element, the tooltip shows, but does not hide when going away from the element. I am using the...
Read more >
Tooltips · Bootstrap v5.0
Documentation and examples for adding custom Bootstrap tooltips with CSS and JavaScript using CSS3 for animations and data-bs-attributes for local title storage ...
Read more >
The problem with tooltips and what to do instead - Adam Silver
The problem with tooltips and what to do instead · # 1. They're hard to spot · # 2. They require effort ·...
Read more >
safari tooltip issue - CodeSandbox
safari tooltip issue. 0. Embed Fork Create Sandbox Sign in. Sandbox Info. safari tooltip issue. 0. 42. 2. shamanthgsshamanthgs. Environmentcreate-react-app.
Read more >

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