Add custom item offset scrolling#615
Open
aaalaniz wants to merge 2 commits into
Open
Conversation
Expose a Listable-owned item scrolling API that lets callers compute a vertical content offset adjustment without accessing the scroll view.
Author
|
🤖 @codex review |
aaalaniz
commented
May 22, 2026
| list.animation = .fast | ||
| list.scrollIndicatorInsets.bottom = 112.0 | ||
|
|
||
| list.autoScrollAction = .pin( |
| @discardableResult | ||
| public func scrollTo( | ||
| item : AnyIdentifier, | ||
| contentOffsetAdjustment : @escaping ListItemScrollPositionAdjustment, |
Author
There was a problem hiding this comment.
I think it's okay that this is marked as escaping but making a note for myself
| } | ||
| } | ||
|
|
||
| self.testcase("skips while dragging") { |
Author
There was a problem hiding this comment.
Add coverage when user specifies to skip scroll during scroll
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.
Adds a Listable-owned API for custom vertical item positioning from both imperative
ListActionsand declarativeAutoScrollAction.What's changed
ListItemScrollPosition.standard(_:)and.verticalContentOffsetAdjustment(_:).AutoScrollAction.scrollTo(... itemPosition:)andpin(... itemPosition:), with existingposition:overloads preserved.AutoScrollAction.ScrollInterruptionPolicy:.performImmediately.deferDuringUserScrolling.skipDuringUserScrollingCustom Auto Scrolling (Footer-Aware Pin).Example
Use
.skipDuringUserScrollingwhen an auto-scroll request should be dropped instead of retried after user scrolling ends.Visuals
auto-scroll-vertical-offset-rotated.mov
Test Plan
mise exec -- xcodebuild test -workspace Development/ListableDevelopment.xcworkspace -scheme ListableDevelopment-Workspace -destination 'id=52DC49DC-0376-4B43-99BE-BC7A016A51B3' -derivedDataPath /tmp/listable-dd-development-tests -only-testing:ListableTestsgit diff --checkCustom Auto Scrolling (Footer-Aware Pin)demo on iOS SimulatorChecklist
Please do the following before merging:
Mainsection.