Skip to content

fix(pkg): Sheet drag is lost when a non-primary scroll position relays out - #642

Merged
fujidaiti merged 2 commits into
fujidaiti:mainfrom
fryette:fix/only-primary-scroll-position-delegates
Nov 14, 2026
Merged

fujidaiti merged 2 commits into
fujidaiti:mainfrom
fryette:fix/only-primary-scroll-position-delegates

Conversation

@fryette

@fryette fryette commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

A sheet drag can be cancelled in the middle of the gesture when a second scroll position attached to the same SheetScrollController relays out. For example, a sheet that contains an Offstage scrollable and a visible scrollable sharing one SheetScrollController: while the user drags the sheet, the hidden scrollable's content size changes, the sheet stops following the finger and the drag is lost.

SheetScrollPosition.goIdle and goBallistic delegated to the sheet whenever any scroll position was primary, not only when the position itself was. A non-primary position that relaid out therefore called goBallistic(0) on the sheet, which replaced the sheet's active drag activity. Only the primary scroll position delegates to the sheet now; other positions run their own idle and ballistic activities.

A regression test reproduces the scenario with an offstage scrollable whose content grows in the middle of a drag.

…s out

A scroll position that is not driving the sheet (e.g. an offstage scrollable sharing the same SheetScrollController) delegated goBallistic and goIdle to the sheet whenever any other position was primary. When such a position relaid out during a drag, it replaced the sheet's active drag activity and the drag was lost. Only the primary scroll position delegates to the sheet now; other positions run their own ballistic and idle activities.
@fryette
fryette requested a review from fujidaiti as a code owner November 8, 2026 15:51

@fujidaiti fujidaiti left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

@fujidaiti
fujidaiti enabled auto-merge (squash) November 14, 2026 04:34
@fujidaiti
fujidaiti merged commit 00ea771 into fujidaiti:main Nov 14, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants