-
Notifications
You must be signed in to change notification settings - Fork 67
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
With animationType='spring', calling 2 times snapTo with same index will block subsequent calls to snapTo #53
Comments
After some time of investigation, I realized that, when the animation is no-op (ie With
With
I was able to debunk the race condition with this but it's not clean: diff --git a/src/index.tsx b/src/index.tsx
@@ -557,7 +558,7 @@ export class ScrollBottomSheet<T extends any> extends Component<Props<T>> {
cond(eq(this.destSnapPoint, snapPoints[0]), [
set(this.dragWithHandle, 0),
]),
- set(this.isManuallySetValue, 0),
+ call([], () => this.isManuallySetValue.setValue(0)),
set(this.manualYOffset, 0),
stopClock(clock),
this.prevTranslateYOffset, |
An other solution would be to use only imperative methods rather than relying on see #54 |
Current Behavior
With this modification of the "bank" example:
To reproduce:
Expected Behavior
Expected:
You can verify the expected behavior if you remove the prop
animationType="spring"
Your Environment
The text was updated successfully, but these errors were encountered: