civiccc / civiccc/react-waypoint

Hybrid offset?

Open
#167 11 comments 2 reactions 0 assignees View on GitHub
question
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 `

` is right 'at flush' to the bottom of the ``.

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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.