fixed-sticky
fixed-sticky copied to clipboard
Does not work correctly anymore in Chrome 52
Hi there,
The polyfill does not work correctly anymore on Chrome 52.
It starts to fix the element on top when you scroll down, but does not release it when you scroll up.
What I found out so far is that the polyfill uses jquery's css-function to get the top and bottom-values and check if these values are "auto" (see https://github.com/filamentgroup/fixed-sticky/blob/master/fixedsticky.js#L93)
the css-function of jquery uses the browsers getComputedStyle-function and this function now (correctly) returns the computed value, not the actual value that is set in the stylesheet.
So this line above (https://github.com/filamentgroup/fixed-sticky/blob/master/fixedsticky.js#L93) will always yield position = {top: true, bottom: true} .
Later isFixedToBottom
will return true because of this and this leads to the problem.
I don't know how to actually fix it yet, but maybe someone has an idea.
ok, got a workaround:
in https://github.com/filamentgroup/fixed-sticky/blob/master/fixedsticky.js#L100 it caches the position-object (with top/bottom true or false) as data-attribute, so it is possible to declare this data-attribute in the html:
<div class="fixedsticky" data-fixed-sticky-position='{"top": true, "bottom":false}'>...
If it is present, it will skip the computation of this values.
Do you mean Chrome 51? That's where I'm having the issue. Chrome 52 should support position: sticky; (http://caniuse.com/#feat=css-sticky).
I am currently on chrome 52 beta and having this issue. position:sticky seems not to be supported yet on chrome 52 (OS X)
I can see the broken behaviour in Chrome 51, 52 (Beta) and 53 (Canary), but it is still working as intended in Chrome 50 (OS X). @macrozone workaround is currently resolving the issue.