Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scrolling stops working in chrome 65 #259

Open
milansimek opened this issue Mar 13, 2018 · 11 comments
Open

Scrolling stops working in chrome 65 #259

milansimek opened this issue Mar 13, 2018 · 11 comments

Comments

@milansimek
Copy link

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
Copy link
Author

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.

@cassius-v
Copy link

Ur solution works fine! Thank You!

@ckosidow
Copy link

ckosidow commented Mar 20, 2018

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

@milansimek
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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

@cassius-v
Copy link

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

@milansimek
Copy link
Author

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

@cassius-v
Copy link

I use sticky kit 1.1.3

@milansimek
Copy link
Author

Same issue when using position:sticky.

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

@chenghong
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants