From 03ddb0de6947e178c51d2a6245d6916c86c445b2 Mon Sep 17 00:00:00 2001 From: Malik Glossop Date: Wed, 22 Jul 2026 13:56:42 +0200 Subject: [PATCH] Merge pull request #35669 from overleaf/mg-fix-comment-scroll Fix scroll for adding comments in editor GitOrigin-RevId: fa9ecb07008bfca1d2e233b4da97817cd77f9105 --- services/web/frontend/js/shared/components/mentions-input.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/web/frontend/js/shared/components/mentions-input.tsx b/services/web/frontend/js/shared/components/mentions-input.tsx index 4f190a7411..433c955403 100644 --- a/services/web/frontend/js/shared/components/mentions-input.tsx +++ b/services/web/frontend/js/shared/components/mentions-input.tsx @@ -123,7 +123,8 @@ export const MentionsInput = forwardRef< () => ({ focus: () => { if (viewRef.current) { - viewRef.current.focus() + // Ensure that the input can be scrolled into view + viewRef.current.contentDOM.focus({ preventScroll: false }) return true } return false