Merge pull request #16706 from overleaf/ii-review-panel-refresh-entry-positions-on-resize

[web] Reposition review panel entries correctly on resize

GitOrigin-RevId: 04f94c20393b1da318560d39175c2b860738998b
This commit is contained in:
ilkin-overleaf 2024-01-25 14:58:51 +02:00 committed by Copybot
parent 140b312eca
commit 55fcf8a0ee

View file

@ -74,12 +74,14 @@ function AutoExpandingTextArea({
}
const resizeObserver = new ResizeObserver(() => {
// Ignore the resize that is triggered when the element is first
// inserted into the DOM
if (!ref.current) {
return
}
const newHeight = ref.current.offsetHeight
// Ignore the resize when the height of the element is less than or equal to 0
if (newHeight <= 0) {
return
}
const heightChanged = newHeight !== previousHeightRef.current
previousHeightRef.current = newHeight
if (heightChanged) {