-
-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat/fix: better slow pan: if user intent is to stay on current page, _don't_ change page #596
base: main
Are you sure you want to change the base?
Conversation
π¦ Changeset detectedLatest commit: 65e3d0f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git βοΈ
|
Incredible work, thank you! But before merging, could you gen a changeset for this PR?
|
I have the feeling that this PR is the one who is going to fix #590 (comment) I'm using alpha.12 and seems like the only remaining bug that I have after migrating from Expo SDK 49 to 50 (thus, alpha0 to 10), is this. Crossed fingers. |
Overview
This improves swipe behavior for my full-screen carousel use case. If a user pans very slowly and ultimately not very far, we would prefer that they stay on the current page. This still allows them to "flick" to pan to the next (or previous) screen.
This should fix the following issue:
Details
nextPage
outside of theif
branchnextPage
, usevelocity * 2
instead ofvelocity * 0.4
: I liked this factor better for my usage. This value seems to work well on all of my iOS and Android test devicesnextPage
is actually the current page, don't go anywhere (previous behavior was to always go to next or previous page)Screen recording
π before patch (4.0.0-alpha.10)
Notice: panning only a little bit always brings user to the next page. This happens even if it seems that the user's intent is to stay on the current page.
Screen.Recording.2024-05-04.at.11.27.07.mov
π before patch: this version shows with some other important patches on top of 4.0.0-alpha.10: this includes #577 (worklets), #574 (useSharedValue), and #576 (panOffset)
Screen.Recording.2024-05-04.at.11.37.12.mov
β with this patch (also includes #577 (worklets), #574 (useSharedValue), and #576 (panOffset))
This shows good behavior with my expected user intent.
Screen.Recording.2024-05-04.at.11.42.55.mov