I have simply code to explain this, i change manualy in DevTools padding bottom check and uncheck.
- when scroll is on red element and I turn off padding bottom, blue element change his padding without scroll to top container
wariant1 - when scroll is on blue element and I turn off padding bottom manual, blue element change padding but after a while scroll goes up untill animation stop
war2 - when i scroll to bottom page, and turn off padding scroll is not running and element correctly changes size
war3
I need use position sticky instead of fixed, and need behavior number 2 in second case
[Codepen](https://codepen.io/arekczap/pen/qBGVvXN)
i dont have idea how to fix this
New contributor
Arekkk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.