mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
TooltipPlugin: Fix console error when data updates while anchored (#88546)
This commit is contained in:
parent
36f42853dd
commit
a257b74d6e
@ -404,6 +404,7 @@ export const TooltipPlugin2 = ({
|
||||
config.addHook('setData', (u) => {
|
||||
yZoomed = false;
|
||||
yDrag = false;
|
||||
dismiss();
|
||||
});
|
||||
|
||||
// fires on series focus/proximity changes
|
||||
@ -526,6 +527,10 @@ export const TooltipPlugin2 = ({
|
||||
return () => {
|
||||
window.removeEventListener('resize', updateWinSize);
|
||||
window.removeEventListener('scroll', onscroll, true);
|
||||
|
||||
// in case this component unmounts while anchored (due to data auto-refresh + re-config)
|
||||
document.removeEventListener('mousedown', downEventOutside, true);
|
||||
document.removeEventListener('keydown', downEventOutside, true);
|
||||
};
|
||||
}, [config]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user