Permalink
Browse files

fix: when chart update, tooltip's _lastActive should be reset. Closed #…

  • Loading branch information...
simaQ committed Aug 23, 2018
1 parent c5e65aa commit 297ae47518ecb73807aa51c1683a5a1bd02f8390
Showing with 5 additions and 2 deletions.
  1. +2 −2 src/plugin/tooltip.js
  2. +3 −0 test/unit/plugin/tooltip-spec.js
@@ -206,6 +206,7 @@ class TooltipController {
tooltip && tooltip.destroy();
this.tooltip = null;
this.prePoint = null;
this._lastActive = null;
this.unBindEvents();
}
@@ -258,7 +259,6 @@ class TooltipController {
const lastActive = this._lastActive;
const tooltip = this.tooltip;
const cfg = this.cfg;
items = _uniqItems(items);
if (cfg.onShow) {
@@ -369,7 +369,7 @@ class TooltipController {
hideTooltip() {
const cfg = this.cfg;
this._lastActive = [];
this._lastActive = null;
const tooltip = this.tooltip;
if (tooltip) {
tooltip.hide();
@@ -104,7 +104,10 @@ describe('Tooltip Plugin', function() {
tooltipController = chart.get('tooltipController');
tooltip = tooltipController.tooltip;
const { prePoint, _lastActive } = tooltipController;
expect(tooltip).to.be.null;
expect(prePoint).to.be.null;
expect(_lastActive).to.be.null;
chart.destroy();
});

0 comments on commit 297ae47

Please sign in to comment.