Repository navigation
Core: Tw::scroll_p*, Tailwind's scroll padding (fixes #439) - #441
Merged
Merged
Conversation
scroll_p, scroll_px, scroll_py, scroll_pt, scroll_pr, scroll_pb and scroll_pl, in spacing units: scrolling a node into view keeps this much between it and the edges of the scroll container. Every scroll-into-view honours it: a keyboard highlight or focus (Wish::Node), scroll_to_rect, and a virtual list's scroll_to_row, which reveals against the same padded view. The wheel, touch and drag are unaffected, as in CSS. A scroll at either end of the content still stops at the content's end. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AJYxo4YJZUXcPJ1bHdAHKy
Scroll padding and the scrollbar class sit side by side on Tw. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AJYxo4YJZUXcPJ1bHdAHKy
Owner
Author
|
Approved by the user after the combobox trial (2026-11-19). GitHub's required checks pass on the branch merged with current main. Merging. |
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 #439.
Tw::scroll_p*, Tailwind's scroll padding (scroll_p,scroll_px,scroll_py,scroll_pt,scroll_pr,scroll_pb,scroll_pl, in spacing units): scrolling a node into view keeps that much between it and the edges of the scroll container. It is honoured by every scroll-into-view: the keyboard highlight and focus (Wish::Node),scroll_to_rect, and a virtual list'sscroll_to_row(which reveals against the same padded view). The wheel, touch and drag are unaffected, as in CSS. A scroll that reaches either end of the content still stops there, so the first row is flush with the top when the content starts there.The class merges per side, the later non-zero value winning; a length that is not finite is ignored and noted, as the layout classes' are.
TODO(prose)is on the method.Tests (
tests/it/scroll_padding.rs, through the real keys in a virtual list driven from a field): arrowing down keeps 4 pt (scroll_py(1.0)) between the highlighted row and the bottom edge; arrowing up from the last row never brings a highlighted row nearer the top than 4 pt, and a row scrolled to sits exactly 4 pt under the top edge (the first row, at the content's start, is flush); with no padding it sits flush; the wheel scrolls by exactly its delta.The scroll, vlist, overflow and listbox tests (214) still pass, with clippy
-D warningsand fmt.🤖 Generated with Claude Code
https://claude.ai/code/session_01AJYxo4YJZUXcPJ1bHdAHKy