diff --git a/services/web/frontend/js/shared/components/auto-expanding-text-area.tsx b/services/web/frontend/js/shared/components/auto-expanding-text-area.tsx index c6968f2330..e1e945084e 100644 --- a/services/web/frontend/js/shared/components/auto-expanding-text-area.tsx +++ b/services/web/frontend/js/shared/components/auto-expanding-text-area.tsx @@ -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) {