-
Notifications
You must be signed in to change notification settings - Fork 25
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
[WIP] Support native sticky #70
base: master
Are you sure you want to change the base?
Conversation
`row` introduced a `overflow: hidden` which is a issue for native `position: sticky` https://stackoverflow.com/questions/43909940/why-does-overflowhidden-prevent-positionsticky-from-working
One solution to not break compatibility could be to add this as an opt-in feature. |
@ctjhoa first thanks for your effort here, and sorry for the late response! Before getting into details, can you explain the motivation for this change? I guess it's mainly about performance, right? But as the native template also includes the trigger components (to continue supporting the yielded |
@simonihmig You're right it's for performance reasons. I think that performance can be split in 2 things. The first thing is the rendering performance which is way better when you let the browser use it's native implementation. Component are rendered smoothly even when you scroll very fast and there is no more "jumpy" rendering cause by javascript computations. Then there are I find more important for the final users to see smooth rendering even if internal states are updated later. So using |
position: fixed always relative to browser window, if i will want start ember application in some container - position: fixed, it will break my app. In this case, maybe it’s worth completing the task? I can help with it. @simonihmig |
Here is a PR to use native
position: sticky
if browser supports it.I think it's good to share my work on that and iterate with maintainers to get at a consensus.
This could bring performance improvements as a majority of browsers support sticky
https://caniuse.com/#feat=css-sticky
Here is the current test results on this branch:
I haven't add new tests yet.
I try to be the most compatible with the existing interface unfortunately there is some limitations:
https://stackoverflow.com/questions/46913063/positionsticky-does-not-leave-parent
which result with inconsistency between old/new behavior.
For example, in the dummy app elements "not sticky to bottom" can't go out of their containers.
old
new
overflow: hidden
. So this may breaks layouts that work today. That's why I need to removerow
class from the dummy app.https://stackoverflow.com/questions/43909940/why-does-overflowhidden-prevent-positionsticky-from-working
I would like your thoughts on this.