diff --git a/public/app/features/logs/components/LogRowMessage.test.tsx b/public/app/features/logs/components/LogRowMessage.test.tsx index bba45d7332c..a30448748b1 100644 --- a/public/app/features/logs/components/LogRowMessage.test.tsx +++ b/public/app/features/logs/components/LogRowMessage.test.tsx @@ -42,6 +42,11 @@ describe('LogRowMessage', () => { expect(screen.queryByText('test123')).toBeInTheDocument(); }); + it('should hide the menu if the mouse is not over', async () => { + setup({ showContextToggle: () => true, mouseIsOver: false }); + expect(screen.queryByLabelText('Show context')).not.toBeInTheDocument(); + }); + describe('with show context', () => { it('should show context button', async () => { setup({ showContextToggle: () => true }); diff --git a/public/app/features/logs/components/LogRowMessage.tsx b/public/app/features/logs/components/LogRowMessage.tsx index d82aa6b3918..7acca5b782a 100644 --- a/public/app/features/logs/components/LogRowMessage.tsx +++ b/public/app/features/logs/components/LogRowMessage.tsx @@ -80,7 +80,7 @@ export const LogRowMessage = React.memo((props: Props) => { } = props; const { hasAnsi, raw } = row; const restructuredEntry = useMemo(() => restructureLog(raw, prettifyLogMessage), [raw, prettifyLogMessage]); - const shouldShowMenu = useMemo(() => mouseIsOver || pinned || true, [mouseIsOver, pinned]); + const shouldShowMenu = useMemo(() => mouseIsOver || pinned, [mouseIsOver, pinned]); return ( <> {