sticky-kit icon indicating copy to clipboard operation
sticky-kit copied to clipboard

Scrolling stops working in chrome 65

Open milansimek opened this issue 7 years ago • 11 comments

When using sticky kit with chrome 65, scrolling stops working if you scroll constantly starting at page load.

It seems it blocks requestAnimationFrame and async deferred loading of resources.

milansimek avatar Mar 13 '18 01:03 milansimek

Found a fix using the following CSS:

.is_stuck {
  transform:translate3d(0,0,0);
}

It seems scrolling doesn't work properly in chrome 65 whenever a fixed element is added to the page.

milansimek avatar Mar 13 '18 05:03 milansimek

Ur solution works fine! Thank You!

cassius-v avatar Mar 20 '18 13:03 cassius-v

This solution works for me thanks so much! How did you come to this solution and why does this work?

ckosidow avatar Mar 20 '18 20:03 ckosidow

It seems that there's a bug in Chrome 65 that messes up scrolling when a fixed element is added to the page. Either scrolling stops or the element won't be added until you stop scrolling.

Adding this CSS will offload the rendering of the element to the GPU, I suppose it makes adding the element non-blocking for the main rendering / JS thread

milansimek avatar Mar 20 '18 21:03 milansimek

It seems they're working on a fix:

https://bugs.chromium.org/p/chromium/issues/detail?id=797708&desc=2#c44

I personally completely ditched sticky kit on our website, and moved to position:sticky in conjunction with the IntersectionObserver API. (had to rewrite a lot of other stuff also by the way)

FYI position:sticky doesn't work in IE11

milansimek avatar Mar 20 '18 21:03 milansimek

Oh yeah, don't forget to cross browser test this solution. The CSS property can cause some rendering issues occasionally

milansimek avatar Mar 20 '18 21:03 milansimek

Thanks again! I have done other tests with chrome and it works very well. Did you see that in Edge sticky element flickers?

cassius-v avatar Mar 21 '18 05:03 cassius-v

Yes, I notice that also indeed. You're also using position:sticky in this case or still the sticky kit library?

milansimek avatar Mar 24 '18 16:03 milansimek

I use sticky kit 1.1.3

cassius-v avatar Mar 25 '18 08:03 cassius-v

Same issue when using position:sticky.

They call it Edge, but it's just IE with another name.

milansimek avatar Mar 26 '18 22:03 milansimek

Hi, do you mind sharing your position:sticky solution?

chenghong avatar Apr 16 '18 09:04 chenghong