WeCodePixels / theia-sticky-sidebar

Glues your website's sidebars, making them permanently visible while scrolling.
MIT License
569 stars 209 forks source link

Scrolling jumps to top unexpectedly on Chrome #3

Closed BenMorel closed 9 years ago

BenMorel commented 10 years ago

First of all congrats for such a wonderful plugin!

I have an issue on Chrome 37 (works fine on IE11 and Firefox 32).

Please open this fiddle in Chrome: http://jsfiddle.net/L1he44bt/

If you scroll down slowly, at some point it will jump back to the top.

Is there any fix for this?

liviucmg commented 10 years ago

Hi Ben,

Thank you for the kind words and for reporting this issue. I've fixed it in the latest version - basically it now skips some steps for sidebars that have the same height as the container. See it here: http://htmlpreview.github.io/?https://github.com/liviucmg/theia-sticky-sidebar/blob/master/examples/foundation.html

I've also made a sweet self-assessment test that simply scrolls the window one pixel at a time, and check if the sidebars move 1px as well (or stay put).

Please check if it works for your.

Cheers!

BenMorel commented 10 years ago

Hi Liviu, thanks so much for your reactivity!

I've tested the master version in my website, as well as your example link above, and although the self-assessment works fine at all window sizes, I'm afraid it still fails when scrolling to the bottom manually!

How to reproduce: open your example link, resize your window to a height slightly smaller than the right column. The self assessment still runs fine, but if you try to scroll manually (not with the mouse wheel, but by dragging the scroll bar) from top to bottom, you should see that it still jumps back to the top as soon as the bottom of the center column reaches the bottom of the window.

It also happens when you scroll down to the point when the right column reaches the bottom of the window, and then you start scrolling back up.

BenMorel commented 9 years ago

@liviucmg Sorry for the ping, but did you have a chance to have a look at this issue?

Thanks again! Ben

liviucmg commented 9 years ago

Awesome, looks like it works without a hitch. Tested both by scrolling manually and using the self-test, on the latest Chrome, Firefox and IE. Thank you for taking the time to look into this!

BenMorel commented 9 years ago

Thanks to you, I think I've tried all the sticky sidebar plugins available to date, and I can tell you that yours is the best by a distance, I would have been sad to have to move away from it :)