Repository navigation
input: Keep a scroll over text that can scroll, even at its end - #3484
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 onmain, 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
cargo runfor 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.)