captivationsoftware / react-sticky

<Sticky /> component for awesome React apps
MIT License
2.64k stars 385 forks source link

Add didNeedCompensation callback #293

Closed Gabiras12 closed 2 years ago

Gabiras12 commented 5 years ago

Add didNeedCompensation param to Sticky component

Use didNeedCompensation function to get padding-bottom for the compensation layer.

I needed this because my sticky has a dynamic height.

And if compensation gets updated with it the page content will not "sync" with the dynamic height on scroll and will go under the sticky before it should. So in my case, I needed a fixed compensation value.