Fix StateTimeline zoom function (#55033) (#55046)

(cherry picked from commit 64869e3d90)

Co-authored-by: Victor Marin <36818606+mdvictor@users.noreply.github.com>
This commit is contained in:
Grot (@grafanabot)
2022-09-12 12:58:11 -04:00
committed by GitHub
co-authored by Victor Marin
parent 7852384e10
commit 25e991c523
@@ -181,10 +181,6 @@ export const StateTimelinePanel: React.FC<TimelinePanelProps> = ({
});
}
if (options.tooltip.mode === TooltipDisplayMode.None) {
return null;
}
return (
<>
<ZoomPlugin config={config} onZoom={onChangeTimeRange} />
@@ -198,6 +194,10 @@ export const StateTimelinePanel: React.FC<TimelinePanelProps> = ({
{enableAnnotationCreation ? (
<AnnotationEditorPlugin data={alignedFrame} timeZone={timeZone} config={config}>
{({ startAnnotating }) => {
if (options.tooltip.mode === TooltipDisplayMode.None) {
return null;
}
return (
<Portal>
{hover && coords && (
@@ -218,7 +218,7 @@ export const StateTimelinePanel: React.FC<TimelinePanelProps> = ({
</AnnotationEditorPlugin>
) : (
<Portal>
{hover && coords && (
{options.tooltip.mode !== TooltipDisplayMode.None && hover && coords && (
<VizTooltipContainer
position={{ x: coords.viewport.x, y: coords.viewport.y }}
offset={{ x: TOOLTIP_OFFSET, y: TOOLTIP_OFFSET }}