You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When jquery is on the page, angular will opt to use it instead of the built in jqlite. jqlite's css() method returns only the style attribute's css. jquery's css() method looks at getComputedStyle() for the values it returns. Both of them may return the wrong value.
This gist demonstrates how this can be a problem when an element has a css class with left: auto. View the HTML in browser and scroll up and down a few times to see the bug happen. Jquery will return "0px", and jqlite returns "", but the true value should be "auto".
With jqlite, an empty string is ok because when unStickValues() is called and an empty string is set for a css value, the property/value pair is ignored and the original css class is applied (in this case, "auto" is used and recomputed).
With jquery, however, unStickElement() will set the incorrect "0px" value. This causes the next stickElement() call to use the "0px" value, which puts the sticky element at the far left of the screen.
Here is a PR addressing the issue. Specifically this fixes the left property, but this bug probably affects other properties.
The text was updated successfully, but these errors were encountered:
When jquery is on the page, angular will opt to use it instead of the built in jqlite. jqlite's
css()
method returns only thestyle
attribute's css. jquery'scss()
method looks atgetComputedStyle()
for the values it returns. Both of them may return the wrong value.This gist demonstrates how this can be a problem when an element has a css class with
left: auto
. View the HTML in browser and scroll up and down a few times to see the bug happen. Jquery will return "0px", and jqlite returns "", but the true value should be "auto".With jqlite, an empty string is ok because when
unStickValues()
is called and an empty string is set for a css value, the property/value pair is ignored and the original css class is applied (in this case, "auto" is used and recomputed).With jquery, however,
unStickElement()
will set the incorrect "0px" value. This causes the nextstickElement()
call to use the "0px" value, which puts the sticky element at the far left of the screen.Here is a PR addressing the issue. Specifically this fixes the
left
property, but this bug probably affects other properties.The text was updated successfully, but these errors were encountered: