From 41a74f0edeaa2de6decc75db279f12a85fa1db0e Mon Sep 17 00:00:00 2001 From: ilkin-overleaf <100852799+ilkin-overleaf@users.noreply.github.com> Date: Tue, 1 Aug 2023 10:51:12 +0300 Subject: [PATCH] Merge pull request #14076 from overleaf/ii-indicator-ref-type-improvement [web] Make the indicator ref type dynamic GitOrigin-RevId: b66aa0f5ffc5c8071462e7e082ece21ef292b4fa --- .../components/review-panel/hooks/use-indicator-hover.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/web/frontend/js/features/source-editor/components/review-panel/hooks/use-indicator-hover.ts b/services/web/frontend/js/features/source-editor/components/review-panel/hooks/use-indicator-hover.ts index ee8128761b..a78a3585e7 100644 --- a/services/web/frontend/js/features/source-editor/components/review-panel/hooks/use-indicator-hover.ts +++ b/services/web/frontend/js/features/source-editor/components/review-panel/hooks/use-indicator-hover.ts @@ -3,6 +3,7 @@ import { flushSync } from 'react-dom' import { useReviewPanelUpdaterFnsContext } from '../../../context/review-panel/review-panel-context' import { useLayoutContext } from '../../../../../shared/context/layout-context' import useScopeValue from '../../../../../shared/hooks/use-scope-value' +import EntryIndicator from '../entries/entry-indicator' export type Coordinates = { x: number @@ -16,7 +17,9 @@ function useIndicatorHover() { const { reviewPanelOpen } = useLayoutContext() const { setLayoutSuspended, handleLayoutChange } = useReviewPanelUpdaterFnsContext() - const indicatorRef = useRef(null) + const indicatorRef = useRef | null>( + null + ) const endHover = useCallback(() => { if (!reviewPanelOpen && !layoutToLeft) {