From 5748ee449690011c612c33f3f164b944a7518e7b Mon Sep 17 00:00:00 2001 From: Tim Down <158919+timdown@users.noreply.github.com> Date: Tue, 5 Sep 2023 15:52:11 +0100 Subject: [PATCH] Merge pull request #14230 from overleaf/td-review-panel-add-comment-reappear React review panel: ensure that "Add comment" entry reappears after clicking away then back GitOrigin-RevId: fc1b656304d71876d8a4728648b73e1d3f873817 --- .../components/review-panel/positioned-entries.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/web/frontend/js/features/source-editor/components/review-panel/positioned-entries.tsx b/services/web/frontend/js/features/source-editor/components/review-panel/positioned-entries.tsx index adcbea387a..e26cbf0a64 100644 --- a/services/web/frontend/js/features/source-editor/components/review-panel/positioned-entries.tsx +++ b/services/web/frontend/js/features/source-editor/components/review-panel/positioned-entries.tsx @@ -210,6 +210,10 @@ function PositionedEntries({ const { reviewPanelOpen } = useLayoutContext() const previousLayoutInfoRef = useRef(initialLayoutInfo) + const resetLayout = () => { + previousLayoutInfoRef.current = initialLayoutInfo + } + const layout = (animate = true) => { const container = containerRef.current if (!container) { @@ -273,6 +277,7 @@ function PositionedEntries({ } if (entryViews.length === 0) { + resetLayout() return }