codecks-io / react-sticky-box

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

Sidebar height change => clicked area still visible #94

Open janfranek opened 1 year ago

janfranek commented 1 year ago

Hi, is it possible to change this great sticky box behaviour a little? Now when you expand sidebar and you're scrolled down, it changes to stickyBottom and content right after clicked button disappears: image

But it would be nicer if sidebar stays "sticked" to top or relative, depends where you are. Like on this image: image So content of your sidebar don't hide outside of screen.

Changing this would make this sticky box more user friendly.

danielberndt commented 1 year ago

As far as I understood, the behavior you are describing is the native position: sticky behavior. In that case you don't need this library. But I might be misunderstanding you here!

janfranek commented 1 year ago

As far as I understood, the behavior you are describing is the native position: sticky behavior. In that case you don't need this library. But I might be misunderstanding you here!

Well, I still want sticky bottom behavior when I scroll down. If you are in the middle of sidebar and you scrolled only down, it works correctly, sticky mode remains Relative. But when you start scrolling up and sticky mode changes to StickyTop. expanding sidebar changes mode to Bottom or Relative, that's unwanted behavior. Sticky Mode should stay sticky top if 1) it was sticky top before and 2) you expand or collapse the sidebar