mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
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:
parent
140b312eca
commit
55fcf8a0ee
1 changed files with 4 additions and 2 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue