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

Support of position: sticky? #17

Open
psaniko opened this issue Sep 6, 2016 · 6 comments
Open

Support of position: sticky? #17

psaniko opened this issue Sep 6, 2016 · 6 comments

Comments

@psaniko
Copy link
Contributor

psaniko commented Sep 6, 2016

Are there any plans to support the upcoming specification of stickily positioned elements?

https://www.w3.org/TR/css-position-3/#sticky-pos

We realize this is quite early and not at all widely supported but we need smooth stickyness on iOS devices and are considering switching to fixed-sticky because of this. As this switch would come with a lot of drawbacks, we would like to know if such an implementation is on the horizon or even at all possible with the current approach.

@harm-less
Copy link
Owner

It seems like this plugin wouldn't even be necessary anymore in many situations 😛 But in terms of performance it would definitely be handy as I can let the browser do the calculations.
A drawback would be that the CSS might not be able to handle stacks.

Perhaps I can make it so the polyfill can hook into the plugin using a wrapper, but then it would be nice that the current engine is hook-able too because that will save file size. I guess I'm making it a bit too complex that way, but I'm just going out on a limb here :)

@psaniko
Copy link
Contributor Author

psaniko commented Oct 7, 2016

Not sure if we can save filesize that way as position:fixed will need to be supported for several years, of course. Let us know any ideas regarding the implementation or plans on your side to implement it, we will probably tackle this issue soon and try to integrate it in angular-sticky.

@harm-less
Copy link
Owner

Next week I'm off from work and you triggered me with this request ;)
So I might be able to address my long awaited attempt at refactoring the sticky engine. With this improvement the code will be much easier to handle and during this refactoring I'll keep your request I mind too.

I might also need to rely more on modernizr if I want to support both sticky methods, but we'll see. I'll keep you informed.

@psaniko
Copy link
Contributor Author

psaniko commented Oct 7, 2016

That's good to know! We'll wait for potential progress then, no pressure :)

@psaniko
Copy link
Contributor Author

psaniko commented Oct 14, 2016

@harm-less Any updates so far?

@axelmichel
Copy link

@harm-less @psaniko There might be a CSS based fix for the flickering of sticky elements on iOS. The combination of forcing hardware acceleration (by using 3D transform) and the usage of backface-visibility did the trick. Applying transform: translate3d(0,0,0); backface-visibility: hidden pushes the graphical processing unit (GPU), and the rendering will be done in a higher FPS rate. All tests (iOS 9,10, iPhone 5,6, iPad 1) had been successful.
Downside of this - applying the transformation by script would override all existing transformations on that element and since all transformations are converted into a matrix, parsing and updating this property could be messy. Anyway, using these CSS-Rules will remove the flickering.

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

3 participants