w11k / angular-sticky-things

Sticky Directive for Angular 2+

Home Page:https://w11k.github.io/angular-sticky-things

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MarginTop not being calcuted properly until browser resized

jaetea opened this issue · comments

commented

I'm running this in an angular app. The one component I have made sticky with a marginTop of 72 doesn't stick until its past the top of the browser window, then will jump to where it should be.

If I resize my browser window it will work properly.

Intial page load (red is sticky element)
image

Element has scrolled off top of screen

image

Element then jumps to where it should be
image

Resize browser (horizontal/vertically)

Offset and stickyness is properly calculated
image

@jaetea any luck im running into this as well.. I have a sticky header globally that I think is confusing it

@robertsmith2 @jaetea should be fixed in version 1.1.0!

For any more corner cases there is now a recalculate method exposed.

Thanks for the bug report!