Skip to content

Chart update breaks custom tooltip render #6363

@Odrin

Description

@Odrin

Expected Behavior

Custom tooltip function executes when mouse leave chart element.

Current Behavior

Custom tooltip function do not executes if chart was updated inside config.hover.onHover callback.

Possible Solution

Problem appears here. chart.update() calls chart.tooltip.initialize(); which resets this._lastActive field and cause false negative result here; Simple solution is just replace this line with this._lastActive = this._lastActive || [];.

Steps to Reproduce (for bugs)

https://codepen.io/anon/pen/qzpPeb

  1. Hover any chart element
  2. Move cursor out of chart

Context

Environment

  • Chart.js version: 2.8.0
  • Browser name and version: Google Chrome Version 75.0.3770.100 (Official Build) (64-bit)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions