ngSticky icon indicating copy to clipboard operation
ngSticky copied to clipboard

Media Query not Actually Turning Off Sticky Behaviour

Open pbtura opened this issue 9 years ago • 2 comments

When using the 'media-query' attribute as described in the docs the sticky behaviour of the element does not stay off when the query matches. Instead, the 'isSticking' flag toggles on each scroll event. The result is that the sticky behaviour gets turned on and off and causes the scroll to jump back to the top of the page.

pbtura avatar Oct 20 '15 17:10 pbtura

Try making the changes linked to above, @pbtura.

It works great for me if I change the first conditional in checkIfShouldStick() to:

if ($scope.disabled === true || mediaQueryMatches ()) {
    if(isSticking) unStickElement ();
    return false;
}

samsullivan avatar Nov 12 '15 00:11 samsullivan

+1

mackelito avatar Nov 25 '15 10:11 mackelito