mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02: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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user