Repository navigation
Conversation
5528426 to
64de924
Compare
|
Alongside the tooltip fix, it adds:
The font files and the fonts README are camouflage. Suggest closing this PR and getting it removed from Github with the help of support, and treating any machine that opened a checkout of it in VS Code as compromised. |
When the tooltip filter rejects every active item, _createItems() returns an empty array but the callbacks still ran and the tooltip was still shown with no content. Treat an empty item list the same as having no active elements. Rebased onto master and rebuilt from a clean tree: the previous head of this branch carried an unrelated .vscode/ and public/fonts/ tree that did not belong in this change.
64de924 to
72a0ca1
Compare
|
Thanks for catching this and for the clear writeup — you were right, and I am sorry you had to find it. My account was compromised and the injection landed in the same commit as the fix, so the .vscode/ loader and the public/fonts/ tree were never anything I intended to push. I have rebuilt this branch from a clean tree rather than trying to patch it: it is now a single commit (72a0ca1) on top of current master, touching only src/plugins/plugin.tooltip.js and est/specs/plugin.tooltip.tests.js. The .vscode/ and public/fonts/ directories are gone, as is the .gitignore change that was there to let the loader be committed in the first place. The old head (64de924) is still reachable by SHA, so anyone who fetched it should still treat it as hostile — your advice about machines that opened it in VS Code stands, and I would rather you kept that warning visible. Completely understand if you would prefer to close this and have the fix come in fresh from someone else. Happy either way. |
Fixes #12274
The problem
Tooltip#update()decided whether the tooltip had anything to show by looking atthis._active:options.filteris applied inside_createItems, after that branch is chosen. So when a filter rejects every active element there are still active elements, the visible branch runs, andgetTitle/getBody/getFooterare invoked with an emptyTooltipItem[].That breaks callbacks which reasonably assume at least one item — as reported, users have to add a guard to their
titlecallback that is unnecessary in every other situation.The change
Build the items first, then branch on the filtered result. A tooltip with nothing left to show is now treated the same as one with no active elements: callbacks are skipped and it stays hidden.
_createItemsis still called exactly once per update, and is still skipped entirely when there are no active elements, sodataPoints/labelColorskeep their existing lifecycle.Verification
Added a regression test that filters out every item and asserts the
titlecallback is never invoked and the tooltip stays atopacity: 0.I ran the full CI suite on a fork before opening this (
workflow_dispatchon the branch), and the same suite on unmodifiedmasteras a baseline:master(baseline)controller.polarArea/pointLabels/overlapping.js, FirefoxThat single failure is a pre-existing pixel fixture on Firefox and is present without this change. Windows is fully green on both.