Skip to content

Commit

Permalink
Merge pull request #349 from abramenal/master
Browse files Browse the repository at this point in the history
docs: update "bottomOffset" description
  • Loading branch information
lencioni authored Apr 28, 2021
2 parents 48dcbb5 + a9ced2e commit 87325a7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,15 @@ enters or leaves the viewport. For details, see [Children](#children), below.
]),

/**
* `bottomOffset` is like `topOffset`, but for the bottom of the container.
* `bottomOffset` can either be a number, in which case its a distance from the
* bottom of the container in pixels, or a string value. Valid string values are
* of the form "20px", which is parsed as pixels, or "20%", which is parsed
* as a percentage of the height of the containing element.
* For instance, if you pass "20%", and the containing element is 100px tall,
* then the waypoint will be triggered when it has been scrolled 20px beyond
* the bottom of the containing element.
*
* Similar to `topOffset`, but for the bottom of the container.
*/
bottomOffset: PropTypes.oneOfType([
PropTypes.string,
Expand Down
10 changes: 9 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,15 @@ declare namespace Waypoint {
topOffset?: string|number;

/**
* `bottomOffset` is like `topOffset`, but for the bottom of the container.
* `bottomOffset` can either be a number, in which case its a distance from the
* bottom of the container in pixels, or a string value. Valid string values are
* of the form "20px", which is parsed as pixels, or "20%", which is parsed
* as a percentage of the height of the containing element.
* For instance, if you pass "20%", and the containing element is 100px tall,
* then the waypoint will be triggered when it has been scrolled 20px beyond
* the bottom of the containing element.
*
* Similar to `topOffset`, but for the bottom of the container.
*/
bottomOffset?: string|number;

Expand Down
9 changes: 8 additions & 1 deletion src/waypoint.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,14 @@ if (process.env.NODE_ENV !== 'production') {
PropTypes.number,
]),

// `bottomOffset` is like `topOffset`, but for the bottom of the container.
// `bottomOffset` can either be a number, in which case its a distance from the
// bottom of the container in pixels, or a string value. Valid string values are
// of the form "20px", which is parsed as pixels, or "20%", which is parsed
// as a percentage of the height of the containing element.
// For instance, if you pass "20%", and the containing element is 100px tall,
// then the waypoint will be triggered when it has been scrolled 20px beyond
// the bottom of the containing element.
// Similar to `topOffset`, but for the bottom of the container.
bottomOffset: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number,
Expand Down

0 comments on commit 87325a7

Please sign in to comment.