Skip to content

Bugfix: Jump to a scroll target unless that call is inside an animated transaction - #558

Open
shiaho777 wants to merge 1 commit into
skiptools:mainfrom
shiaho777:fix-scrollto-unanimated-marker
Open

shiaho777 wants to merge 1 commit into
skiptools:mainfrom
shiaho777:fix-scrollto-unanimated-marker

Conversation

@shiaho777

Copy link
Copy Markdown

ScrollViewProxy.scrollTo decided whether to animate by reading Animation.isInWithAnimation inside a coroutine. That flag is the marker left for one frame after some other withAnimation, so a later scrollTo from onChange or a task used animateScrollToItem and traveled the whole list.

The decision is now taken on the calling thread, before the coroutine starts. A scroll animates only when the transaction active for that call has an animation. The post-exit marker does not count. TabView still uses the marker for its own page sync.

This addresses Issue #469.


Thank you for contributing to the Skip project! Please review the contribution guide at https://skip.dev/docs/contributing/ for advice and guidance on making high-quality PRs.

Use this space to describe your change and add any labels (bug, enhancement, documentation, etc.) to help categorize your contribution.

Skip Pull Request Checklist:

  • REQUIRED: I have signed the Contributor Agreement
  • REQUIRED: I have tested my change locally with swift test
  • OPTIONAL: I have tested my change on an iOS simulator or device
  • OPTIONAL: I have tested my change on an Android emulator or device
  • REQUIRED: I have checked whether this change requires a corresponding update in the Skip Fuse UI repository (link related PR if applicable)
  • OPTIONAL: I have added an example of any UI changes to the Showcase sample app

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes.

An AI assistant drafted the scroll decision and the Swift tests. swift test passed, including the transpiled Android unit tests that command runs locally. ScrollToMotionTests passed. No Android emulator or device was used, so the Compose scroll itself was not checked on a device. Skip Fuse UI depends on SkipUI and does not duplicate these scroll containers, so it does not need a separate change.


…d transaction

scrollTo was reading the post-exit withAnimation marker from inside a later coroutine, so a scroll after another animation moved with animateScrollToItem. The decision is taken on the calling thread and follows only the transaction active for that call.
@cla-bot

cla-bot Bot commented Oct 9, 2026

Copy link
Copy Markdown

Thank you for your pull request and welcome to the Skip community. We require contributors to sign our contributor license agreement (CLA), and we don't seem to have the user(s) @shiaho777 on file. In order for us to review and merge your code, for each noted user please add your GitHub username to Skip's .clabot file

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.

1 participant