The sheet's follower asks whether a scroll is under way, it does not watch it
CI / check (push) Canceled after 0s
CI / check (push) Canceled after 0s
Watching it made every scroll to the end start the next one: our own scroll is a scroll too. CI run 100 hung in the screenshot tests on it. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 file changed
+5
-3
@@ -242,9 +242,11 @@ fun ColumnScope.AssistSheetContent(
|
||||
// it is not known yet.
|
||||
LaunchedEffect(scroll) {
|
||||
// Never against a finger: nothing is moved while a scroll is under way, and one of
|
||||
// ours that a finger interrupts does not end this follower (`yielding`).
|
||||
snapshotFlow { if (following && !scroll.isScrollInProgress) scroll.maxValue else -1 }
|
||||
.collect { end -> if (end in 0 until Int.MAX_VALUE) yielding { scroll.scrollTo(end) } }
|
||||
// ours that a finger interrupts does not end this follower (`yielding`). Whether a
|
||||
// scroll is under way is asked here and not watched: our own scroll is one too, and
|
||||
// watching it would have each scroll to the end start the next.
|
||||
snapshotFlow { if (following) scroll.maxValue else -1 }
|
||||
.collect { end -> if (end in 0 until Int.MAX_VALUE && !scroll.isScrollInProgress) yielding { scroll.scrollTo(end) } }
|
||||
}
|
||||
|
||||
// The top: the handle and the bar. Both drag the sheet.
|
||||
|
||||
Reference in new issue
Block a user