Skip to content

Commit

Permalink
fix: android scroll momentum glide
Browse files Browse the repository at this point in the history
  • Loading branch information
rgommezz committed May 13, 2020
1 parent 053ed1c commit 47e3496
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,20 @@ export class ScrollBottomSheet<T extends any> extends Component<Props<T>> {
calculateNextSnapPoint()
)
),
cond(
and(greaterThan(dragY, lastStartScrollY), isAndroid),
call([], () => {
// This prevents the scroll glide from happening on Android when pulling down with inertia.
// It's not perfect, but does the job for now
// @ts-ignore
this.contentComponentRef.current?._component.scrollToIndex({
index: 0,
animated: true,
viewPosition: 0,
viewOffset: 1000,
});
})
),
set(dragY, 0),
set(velocityY, 0),
set(
Expand Down

0 comments on commit 47e3496

Please sign in to comment.