manufont / react-swipeable-bottom-sheet

A swipeable material's bottom sheet implementation, using react-swipeable-views
MIT License
131 stars 36 forks source link

Scroll Bug on Controlled Component with Touch event #18

Open ashkanahrabi opened 3 years ago

ashkanahrabi commented 3 years ago

Hi there,

I just set the open={isOpen} to use the controlled component, but when it's true and the body content is scrollable, swiping up causes a jump on scroll.

This issue occurs only when I swipe up with touch event.

Any ideas?

ashkanahrabi commented 3 years ago

@manufont Any updates?

teamhide commented 3 years ago

Same issue here

mmdzov commented 3 years ago

I had the same problem yesterday, I took the time today to check and see that line 80 of the SwipeableBottomSheet.js file has a problem

if (overflowHeight === 0) {
this.bodyElt.scrollTop = 0;
}

So I concluded that instead of setting overflowHeight to 0, I set it to 1

You can do this to solve your problem, but you must make the following condition for it to work properly:

overflowHeight = {! open? 0: 1}