locomotivemtl / locomotive-scroll

🛤 Detection of elements in viewport & smooth scrolling with parallax.
https://locomotivemtl.github.io/locomotive-scroll
MIT License
7.54k stars 1.11k forks source link

scrollTo with a target outside the scrolling bounds and disableLerp on true messes up sticky elements #529

Open psc-44 opened 7 months ago

psc-44 commented 7 months ago

Calling the scrollTo function with a target outside the scrolling bounds and disableLerp on true messes up sticky elements. The sticky elements are not updated. It works when disableLerp is set to false.

To Reproduce

  1. Create a scrollable container (2000px high)
  2. Create a sticky element in that scrollable container
  3. Call the scrollTo function with a target outside the scrolling bounds (3000) and disableLerp on true
  4. The sticky element is not updated, only when the user scrolls by themselves.

Desktop: