mirror of
https://github.com/grafana/grafana.git
synced 2025-02-10 07:35:45 -06:00
BarChart: Fix Sticky Tooltip (#45017)
This commit is contained in:
parent
01d961c824
commit
ed7b9905c2
@ -252,7 +252,7 @@ export const BarChartPanel: React.FunctionComponent<Props> = ({ data, options, w
|
||||
width={width}
|
||||
height={height}
|
||||
>
|
||||
{(config, alignedFrame) => {
|
||||
{(config) => {
|
||||
if (oldConfig.current !== config) {
|
||||
oldConfig.current = setupConfig({
|
||||
config,
|
||||
|
@ -33,6 +33,11 @@ export const setupConfig = ({
|
||||
}: SetupConfigParams): UPlotConfigBuilder => {
|
||||
config.addHook('init', (u) => {
|
||||
u.root.parentElement?.addEventListener('click', onUPlotClick);
|
||||
u.over.addEventListener('mouseleave', () => {
|
||||
if (!isToolTipOpen.current) {
|
||||
setCoords(null);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
let rect: DOMRect;
|
||||
|
Loading…
Reference in New Issue
Block a user