Skip to content

input: Keep a scroll over text that can scroll, even at its end - #3484

Merged
huacnlee merged 3 commits into
longbridge:mainfrom
shreeve:fix/input-keep-scroll
Oct 13, 2026
Merged

huacnlee merged 3 commits into
longbridge:mainfrom
shreeve:fix/input-keep-scroll

Conversation

@shreeve

@shreeve shreeve commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Description

A textarea or editor stopped a scroll packet only while its own offset still moved. Once the text reached its end, the rest of a swipe, its momentum, and every later wheel flick over the text scrolled the region around the input instead: in a scrolling page, the page started moving while the pointer was still over the textarea.

Text with room to scroll along the axis the packet mostly moves on now keeps the scroll even where it ends, so the pointer over a scrollable input scrolls only that input. This follows the Design Guides' region-owned scrolling. Text that fits still leaves the scroll to the region around it, and a single-line input still passes vertical scrolling through, as #1572 intended, even when a trackpad swipe drifts a little sideways over text wider than the input. The Textarea docs, in English and Chinese, describe the scroll staying in the textarea.

Breaking Changes

Scrolling over a textarea or editor whose text can scroll no longer reaches the page around it once the text is at its end: the rest of that swipe, its momentum, and later wheel flicks over the text stay in the input. Text that fits, and vertical scrolling over a single-line input, still scroll the page. No setting restores the old behavior; to scroll the page, move the pointer off the input.

How to Test

cargo test -p gpui-kit --features test-support,component --test input scrolling_
  • scrolling_past_the_end_of_a_textarea_does_not_scroll_the_page: a textarea partway down a scrolling page; a swipe that runs past the end, its momentum, then a wheel flick and a new swipe at the end. It fails on main, where the page scrolls 300px.
  • scrolling_over_a_textarea_whose_text_fits_scrolls_the_page: passes before and after.
  • scrolling_vertically_over_a_single_line_input_scrolls_the_page: a mostly vertical swipe over a single-line input whose text is wider than it still scrolls the page. Passes before and after.

AI-assisted: written with Claude Code and reviewed by me before submission.

Checklist

  • I have read the CONTRIBUTING document and followed the guidelines.
  • Reviewed the changes in this PR and confirmed AI generated code (If any) is accurate.
  • Passed cargo run for story tests related to the changes. (Textarea story: wheeling past the end of the Auto Grow textarea leaves the page where it is; with the pointer off the textarea the page scrolls.)
  • Tested macOS, Windows and Linux platforms performance (if the change is platform-specific). (Not platform-specific; these commits passed CI on all three: run 38352693812.)

shreeve and others added 3 commits October 12, 2026 15:11
A textarea or editor stopped a scroll packet only while its own offset still
moved. Once the text reached its end, the rest of a swipe, its momentum, and
every later wheel flick over the text scrolled the region around the input
instead. Text with room to scroll along the packet's axis now keeps the scroll
even where it ends, so the pointer over a scrollable input scrolls only that
input. Text that fits still leaves the scroll to the region around it, and a
single line still passes vertical scrolling through.
A trackpad swipe drifts a little off its axis, so a mostly vertical swipe
over a single-line input whose text is wider than it was kept by the input
at its start or end, and the page around it stopped scrolling. Decide by the
axis the scroll mostly moves on. Document the scroll staying in a textarea.
@huacnlee
huacnlee enabled auto-merge (squash) October 13, 2026 14:15
@huacnlee
huacnlee merged commit 4ee8201 into longbridge:main Oct 13, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants