BarChart: Fix Sticky Tooltip (#45017)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user