civiccc / civiccc/react-waypoint
Hybrid offset?
- Dominant language
- JavaScript
- Stars
- 4k
- Forks
- 206
- PR merge metrics
- No merged PRs in 30d
Description
I was reading the source code of `computeOffsetPixels.js` and now understand how it works. I would like to raise an discussion on a possible expansion for the **"hybrid offset"**, e.g. allowing `100% - 50px`:
I found one use case in my project where I use `react-waypoint` as a scrollspy agent. I have a fixed-height `` at the top of the page. And I want to trigger something when the user scroll down to a point where a `
Since I want the above behavior when scrolling down, I need to use `bottomOffset`, not `topOffset` (right?). So basically I need `100% - 50px`-ish value for `bottomOffset`, which is not supported. Such functionality will be handy, since `_handleScroll()` gets the bound from `_getBounds()` fresh, and that takes care of resizing issues.
Contributor guide
Assessment
This issue has not been assessed yet.