Repository navigation
Scroll: a wheel over a scroll bar scrolls the viewport it follows - #1214
Merged
Merged
Conversation
Member
Author
|
macOS tests,
|
The bar's track draws over the viewport's right edge as its sibling (both in the `area` column), and since #1137 a wheel starts on the topmost hit and chains up its ancestors. So a wheel over the bar's strip started on the track, whose only ancestors were the area column and the window, and found no scroller: every scroll view lost wheel scrolling over its rightmost points, and a wide table lost its sideways wheel. `El::wheel_scrolls(key)` names the viewport an element's wheel belongs to, and the kit's bars name the viewport they follow. `scroll_in_chain` takes that hand-off before walking on, so it holds on both axes: a wheel over the bar scrolls the viewport it follows, then chains on up from it when that one is at its end, as a wheel over the viewport itself does. Chromium's scrollbar belongs to its scroller the same way; a press or drag on the bar is unchanged. The key is resolved in the element's own place, looked up inside the element itself and then its ancestors, innermost first, so panes and tables that key their viewports alike each take their own wheel (`markdown/table.rs` keys every wide table's viewport `scroll`). The first scope holding a match decides: one on its way out or inert hands the wheel nowhere rather than to another pane's. `in_scope`'s key-name scoping can't tell repeated keys apart, so the boundary is the tree's own subtree, while the match inside it is `named`, as `Tx::scroll_into_view` names one. `on_wheel` handlers under the pointer still hear the wheel first; one on the named viewport does not, since the pointer is over the bar and not the viewport. Fixes #1200.
thdxr
force-pushed
the
fix-wheel-over-scrollbar
branch
from
November 19, 2026 05:34
dddcd4a to
dece2bf
Compare
This was referenced Nov 23, 2026
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.
fixes #1200.
the bar's track draws over the viewport's right edge as its sibling (both in the
areacolumn), and since #1137 a wheel starts on the topmost hit and chains up its ancestors. so a wheel over the bar's strip started on the track, whose only ancestors were the area column and the window, and found no scroller: every scroll view lost wheel scrolling over its rightmost points, and a wide table lost its sideways wheel.El::wheel_scrolls(key)names the viewport an element's wheel belongs to, and the kit's bars name the viewport they follow. the hand-off lives inscroll_in_chain(pointer.rs), which both axes walk, so a wheel over the bar scrolls the viewport it follows on whichever axis it turned, then chains on up from it when that one is at its end. chromium's scrollbar belongs to its scroller the same way; a press or drag on the bar is unchanged.the key is resolved in the element's own place: looked up inside the element itself, then its ancestors, innermost first, so panes and tables that key their viewports alike each take their own wheel (
markdown/table.rskeys every wide table's viewportscroll). the first scope holding a match decides — one on its way out or inert hands the wheel nowhere rather than to another pane's.in_scope's key-name scoping can't tell repeated keys apart, so the boundary is the tree's own subtree while the match inside it isnamed, asTx::scroll_into_viewnames one.on_wheelhandlers under the pointer still hear the wheel first; one on the named viewport does not, since the pointer is over the bar and not the viewport.tests (fail on origin/dev's plain
scroll_in_chain, pass here):runea_sideways_wheel_over_a_bar_scrolls_the_viewport_it_follows: a sideways wheel over a two-way pane's vertical track scrolls it across (x.offset0 → 40) and leaves it where it was down, and over a table's horizontal track scrolls the table (x.offset0 → 40). before: both 0.runea_wheel_over_an_element_that_names_its_viewport_scrolls_that_viewport(0 → 30),a_wheel_a_named_viewport_cannot_take_chains_up_from_it,a_wheel_over_one_pane_s_bar_scrolls_that_pane_when_the_panes_key_alike,a_raised_panel_over_a_bar_keeps_the_wheel_from_the_viewport_under_it.rune-kitmarkdown::tests::a_wheel_over_a_table_s_scroll_bar_scrolls_its_own_pane: two panes each rendering a wide markdown table — a vertical wheel over the second table's bar scrolls the second pane (before: the first pane scrolled, 30 vs 0), i.e. a vertical wheel over a horizontal bar still chains up to its pane.rune-kita_wheel_over_the_bar_scrolls_the_viewport_it_follows: the issue's repro.macOS (
macos-tests.yml,workflow_dispatch): run 44466141090 ondece2bf2— success, and all six wheel tests pass there.