kornelski / slip

Slip.js — UI library for manipulating lists via swipe and drag gestures
BSD 2-Clause "Simplified" License
2.44k stars 213 forks source link

Autoscrolling issue when html/body set to 100% #28

Closed guillerodriguez closed 8 years ago

guillerodriguez commented 10 years ago

I am seeing issues with autoscrolling when the height of the html and body elements is set to 100% (so that the body fills the whole viewport). I have fixed this by modifying updatePosition() to include scrollable.scrollTop in the calculation of bottomOffset:

bottomOffset = Math.min(scrollable.scrollTop + containerRect.bottom, window.innerHeight) - targetRect.bottom,

This seems to fix the problem.

Does this look correct?

henrikhermansen commented 9 years ago

I had issues with scrolling on mobile, the page kept skipping up and down. Substituting this line seems to have fixed it. Thanks!

guillerodriguez commented 9 years ago

@henrikhermansen -- thank you for letting me know. I am also using this myself with good results.

carter-thaxton commented 8 years ago

I believe these issues were fixed in #72. Please feel free to reopen if you discover otherwise.