react-stickup
react-stickup copied to clipboard
api for estimated offsets for a given scroll position
When using window.scrollTo
to scroll to a specific position in the application the developer needs to know in advance how large the offset will be so that the element is not hidden by a sticky element.
A public api to estimate this position by x
and y
coordinates would solve this need.
Instead of a public API, adding scroll-margin
by default might even be a better approach as it would make scrollTo
work by default (I guess): https://css-tricks.com/almanac/properties/s/scroll-margin/