Check out my codepen showing the problem. The element becomes sticky when it reaches the element.ofssetTop. Everything works fine so far. The problem is when I'm scrolling back to top. I see jumping instead of a smooth transition.
`https://codepen.io/gondziu/pen/poVNWBq`
EDIT: Everything works now, if someone needs the js vanilla affix script check the codepen.