From 47e4d954968c89cfb1f4aca51b0827b1a76bdd11 Mon Sep 17 00:00:00 2001 From: Jack Date: Mon, 25 May 2020 17:49:54 -0700 Subject: [PATCH] Fix issue with bound bottom conditions being hit when element is larger than context --- src/definitions/modules/sticky.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/definitions/modules/sticky.js b/src/definitions/modules/sticky.js index 436b1c3eb..48207fd09 100755 --- a/src/definitions/modules/sticky.js +++ b/src/definitions/modules/sticky.js @@ -438,7 +438,7 @@ $.fn.sticky = function(parameters) { }, size: function() { if(module.cache.element.height !== 0 && module.cache.element.width !== 0) { - element.style.setProperty('width', module.cache.element.width + 'px', 'important'); + element.style.setProperty('width', module.cache.element.width + 'px', 'important'); element.style.setProperty('height', module.cache.element.height + 'px', 'important'); } } @@ -501,7 +501,7 @@ $.fn.sticky = function(parameters) { module.bindBottom(); } else if(scroll.top > element.top) { - if( (element.height + scroll.top - elementScroll) >= context.bottom ) { + if((element.height + scroll.top - elementScroll) >= context.bottom && element.height < context.height) { module.debug('Initial element position is bottom of container'); module.bindBottom(); }