react-sticky icon indicating copy to clipboard operation
react-sticky copied to clipboard

bottomOffset in relative mode not functional

Open bradduck opened this issue 7 years ago • 2 comments

I have a use case where the stick element is within an overflowing <StickyContainer />, yet requires a bottomOffset. It appears as though bottomOffset does not work correctly when <Sticky> is in relative mode. I believe I have a fix that will correct this:

const bottomDifference = (this.props.relative ? parent.scrollHeight - parent.scrollTop : distanceFromBottom) - this.props.bottomOffset - calculatedHeight;

Thoughts on this change? Is there another way to accomplish what I'm trying to do?

bradduck avatar Apr 04 '18 01:04 bradduck

Hm could you make a Code Sandbox or similar? I'm not sure I understand what the problem is.

vcarl avatar Apr 04 '18 17:04 vcarl

Sure, will do... I'll try to get one done this weekend.

bradduck avatar Apr 06 '18 01:04 bradduck