codecks-io / react-sticky-box

Sticky boxes for contents of all sizes
https://react-sticky-box.codecks.io/
ISC License
458 stars 44 forks source link

Layout broken in short viewport when changing scrollY #98

Open MrGGTo opened 9 months ago

MrGGTo commented 9 months ago

I noticed a layout bug with the sticky box. The sticky box did not detect the scrollY change, breaking the layout as shown in the preview.

To reproduce this:

  1. Resize the window to let the sticky box's height > viewport's height.
  2. scroll above the sticky box (make sure to scroll out of the sticky zone)
  3. click on a anchor tag to trigger a change in scrollY

https://github.com/codecks-io/react-sticky-box/assets/56320644/ae3662e8-6c6b-4005-8f7a-a4479593bf78

Could this be fixed? Thanks, this is a useful library