Skip to content

Tooltips not showing up when the viewport is at a specific size #7594

@mlorant

Description

@mlorant

Expected Behavior

Using the following config, I would expect the tooltip to appear whenever I hover the chart:

     Chart.Line(ctx, {
            data: {
                [... some data ...]
            },
            options: {
                legend: false,
                tooltips: {
                    mode: 'index',
                    intersect: false,
                },

                hover: {
                    mode: 'nearest',
                    intersect: true
                },
                ...

Current Behavior

In a very particular situation, when the viewport has the exact size to make the old #2127 appears, the tooltips are not showing up.

Possible Solution / Context

Not really a solution but I'm 99.999 % sure this is related to the issue #2127 + the pull request #6011.
I had the bug explained in the issue referenced above. I've decided to upgrade our ChartJS version to the last one (2.9.3), since the PR 6011 seems to resolve the flickering bug.
The bug was indeed solved but when hovering the graph the tooltips no longer appear. If I change the viewport size (by opening the devtools or resizing my browser window) it works again, without refreshing the page

Here's a summary in a .gif, in the order: the flickering situation with the 2.7.x, the graph with the exact same viewport size with 2.9.3 and a third page where my browser is resized. See the title above the graph for each situation.

out

Environment

  • Chart.js version: 2.7.2 then 2.9.3
  • Browser name and version: Firefox 78.0.1
  • Link to your project: The page showed above is from a private project, I guess I can reproduce it elsewhere if really needed

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions