]> git.ipfire.org Git - thirdparty/Chart.js.git/commit
Tooltip fixes (getLabelAndValue on null controller, null getParsed) (#11596)
authorJosh Kelley <joshkel@gmail.com>
Wed, 29 Nov 2023 19:51:56 +0000 (14:51 -0500)
committerGitHub <noreply@github.com>
Wed, 29 Nov 2023 19:51:56 +0000 (14:51 -0500)
commit429d99dbc2bd4b098da95091230fba9af6c4b4bb
treed4b3bccc2fc70e266c4b71301ef72bc79708ee86
parente92d10445bc60af48dc9e4ae87b40d4193762ab9
Tooltip fixes (getLabelAndValue on null controller, null getParsed) (#11596)

* Fix for getLabelAndValue on null controller

I encountered #11315 under the following circumstances:

1. Position the cursor over the chart area, such that it causes a
   tooltip to be shown.
2. Move the cursor out of the chart area, such that the tooltip remains
   visible.
3. Cause the chart contents to be changed, such that the dataset
   referenced by the active tooltip element is no longer valid.
4. Move the mouse again.  This triggers an `inChartArea = false` event,
   so it reuses the previous, now invalid, active elements.

This fixes #11315 under the circumstances for which I've reproduced it,
but there may be others.

* Further fixes for elements added / changed

This possibly fixes #11365.
src/plugins/plugin.tooltip.js
test/specs/plugin.tooltip.tests.js