Skip to content

fix(mobile): follow the Android composer caret while typing - #14977

Closed
egefeyzioglu wants to merge 2 commits into
pingdotgg:mainfrom
egefeyzioglu:fix/android-composer-caret-scroll
Closed

egefeyzioglu wants to merge 2 commits into
pingdotgg:mainfrom
egefeyzioglu:fix/android-composer-caret-scroll

Conversation

@egefeyzioglu

Copy link
Copy Markdown

Problem

On Android, once the chat composer reaches its max height it stops following the caret. Typing a long prompt leaves the current line out of view, and the user has to scroll the input by hand. Reported in #12690 on Samsung One UI devices and with physical keyboards.

Fix

The native editor now scrolls its own content so the caret line stays inside the viewport. SelectionAwareEditText computes the caret line from the text layout and adjusts scrollY when that line falls outside the padded viewport. It runs after text changes, selection changes, layout changes, controlled setSelection calls from JS, and when scrolling is enabled. scrollTo is a no-op while the composer is collapsed so the pill never jumps.

Fixes #12690

Evidence

I could not reproduce the bug on a Pixel 7 API 36 emulator with Gboard. Stock EditText already follows the caret there, on upstream main. The reports are from Samsung One UI and physical keyboards, so this still needs a check on a real device before merging.

upstream main (emulator) this branch (emulator)
before after

Done with Claude Fable 5.1 via Claude Code.

🤖 Generated with Claude Code

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug][Mobile] Android composer does not scroll the current line into view while typing a long prompt

1 participant