mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fix: when clicking a plot on a touch device we won't display the annotation menu (#21479)
* Fixed so when clicking a plot on a touch device we won't display the annotation context menue. * Refactorings after feedback. * changed to standard-ish comment.
This commit is contained in:
@@ -172,6 +172,18 @@ export default function GraphTooltip(this: any, elem: any, dashboard: any, scope
|
||||
appEvents.emit(CoreEvents.graphClicked, { pos: pos, panel: panel, item: item });
|
||||
});
|
||||
|
||||
elem.bind('plotleave', () => {
|
||||
if (!panel.tooltip.shared) {
|
||||
return;
|
||||
}
|
||||
|
||||
const plot = elem.data().plot;
|
||||
if (plot) {
|
||||
$tooltip.detach();
|
||||
plot.unhighlight();
|
||||
}
|
||||
});
|
||||
|
||||
this.clear = (plot: { clearCrosshair: () => void; unhighlight: () => void }) => {
|
||||
$tooltip.detach();
|
||||
plot.clearCrosshair();
|
||||
|
||||
Reference in New Issue
Block a user