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 b278727171..c6968f2330 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 @@ -111,8 +111,10 @@ function AutoExpandingTextArea({ resetHeight() if (autoFocus) { const cursorPos = el.value.length - el.focus() - el.setSelectionRange(cursorPos, cursorPos) + window.setTimeout(() => { + el.focus() + el.setSelectionRange(cursorPos, cursorPos) + }, 100) } }, [autoFocus, resetHeight])