Fix StateTimeline zoom function (#55033)

storybook-table
Victor Marin 3 years ago committed by GitHub
parent 445e1b3eae
commit 64869e3d90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      public/app/plugins/panel/state-timeline/StateTimelinePanel.tsx

@ -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 }}

Loading…
Cancel
Save