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
This commit is contained in:
Tim Down 2023-09-05 15:52:11 +01:00 committed by Copybot
parent df393a3b9a
commit 5748ee4496

View file

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