Skip to content

feat(pkg): Add SheetController.jumpTo - #643

Open
fryette wants to merge 2 commits into
fujidaiti:mainfrom
fryette:feat/sheet-controller-jump-to
Open

fryette wants to merge 2 commits into
fujidaiti:mainfrom
fryette:feat/sheet-controller-jump-to

Conversation

@fryette

@fryette fryette commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

SheetController gains jumpTo(SheetOffset), which moves the sheet to the given offset immediately, without animating, mirroring ScrollController.jumpTo. The sheet stays idle with that offset as its target, so the position is re-resolved whenever the viewport or the content changes (for example a viewport that is resized after the jump), until another movement such as a drag or animateTo begins. A running animation that jumpTo interrupts completes its future, as it does for any other interruption.

animateTo cannot be used for this: AnimatedSheetActivity asserts that the duration is positive, even a tiny duration shows the old offset for at least one frame, and on completion the sheet calls goBallistic(0), so a target that lies between snap offsets is not kept.

Related to #551; the use case is described in #551 (comment).

SheetController.jumpTo moves the sheet to the given offset immediately, without animating, and keeps it idle with that offset as its target, so the position is re-resolved whenever the viewport or the content changes. animateTo cannot do this: it requires a positive duration, even a tiny one shows the old offset for at least one frame, and on completion the sheet settles to the nearest snap offset rather than keeping a target between snaps. jumpTo mirrors ScrollController.jumpTo.
@fryette
fryette requested a review from fujidaiti as a code owner November 8, 2026 15:51
@fujidaiti

Copy link
Copy Markdown
Owner

Hi @fryette,

I looks like this is a duplicate of #552. Can you take a look at this comment?

@fujidaiti fujidaiti added the waiting for op's response No further progress can be made on this issue until the original reporter responds label Nov 14, 2026
@fryette

fryette commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, and sorry I missed #552. I've answered your question in #551 (comment). My use case is programmatic placement of sheets that are still draggable, not finger following.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting for op's response No further progress can be made on this issue until the original reporter responds

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants