Closed PradeepJaiswar closed 5 years ago
Hi! topOffset
prop has a bit differ purpose
Sticky state will be triggered when the top of the element is topOffset pixels from the top of the scrollElement. Positive numbers give the impression of a lazy sticky state, whereas negative numbers are more eager in their attachment (check .
if you want to add an offset when element becomes sticky you can use something like this:
<Sticky id="detailSticky" topOffset={50} stickyStyle={{ transform: 'translateY(50px)' }}> /* children */ </Sticky>
Following should also work
<Sticky id="detailSticky" topOffset={-50} stickyStyle={{ paddingBottom: 50 }}> /* children */ </Sticky>
Still, inline style always says top: 0px when getting sticks. It should be equal to topOffset provided