Repository navigation
feat: add scroll_to to scrollable controls - #31
Merged
Merged
Conversation
ListView, GridView, Column, Row, View and ReorderableListView now share a ScrollableMethods mixin whose scroll_to invokes the renderer's existing scroll_to method (offset, delta, scroll_key, duration, curve) on that control instead of only on the page.
This was referenced Oct 28, 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.
Package A / A0 (
scroll-methods). Engine counterpart: AdamMusa/ruflet-engine#15 (Cupertino ReorderableListView answersscroll_to).What
New
Ruflet::UI::Controls::ScrollableMethodsmixin (controls/shared/scrollable_methods.rb). It is included in ListViewControl, GridViewControl, ColumnControl, RowControl, ViewControl and ReorderableListViewControl. Before this, onlyPage#scroll_toexisted, and it targets the page rather than a given list. A1 (pull-to-refresh) addsend_refreshto the same module.Only the arguments you pass are sent. On a control that isn't mounted yet (no runtime page) it returns
nilwithout raising.Usage
A Column or Row has a scroll view only when
scroll:is set, soscroll_tois a no-op otherwise. A refreshable Column (A1) always scrolls.Wire
Invoke
scroll_toon the control's own id. Args areoffset,delta,scroll_key,duration(ms) andcurve, the same namesPage#scroll_toand the DartScrollableControlalready use. No new props or events.Material vs Cupertino
Both renderers answer through
ScrollableControl. The engine PR fixes the one renderer that didn't: the Cupertino ReorderableListView.Tests
New
test/scrollable_methods_compatibility_test.rb(6 runs, 29 assertions), using a page with asender:lambda:name,control_id == wire_id, args and timeoutView#scroll_totargets the view, not page id 1on_resultreceives the client resultverify_pr.sh:The new file follows the mruby rules: no
defined?and no Regexp. Each including file does its ownrequire_relative, so load order betweenmaterials/andshared/doesn't matter.