civiccc / civiccc/react-waypoint

onEnter and onLeave horizontal is triggered on vertical scroll

Open
#351 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
4k
Forks
206
PR merge metrics
No merged PRs in 30d

Description

# Expected Behavior #
onEnter and onLeave are triggered when the component enters and leaves the viewport when the parent div is scrolled horizontally, when prop horizontal is given.
# Current Behavior #
onEnter and onLeave correctly inform if the component is in view, but they are only triggered when the page is scrolled vertically.
# Steps to Reproduce #
Component
```

```
Handlers
```
const _handleWaypointEnter = () => {
setInView(true);
setChangeCount(changeCount + 1);
};
const _handleWaypointLeave = () => {
setInView(false);
setChangeCount(changeCount + 1);
};
```
### React: 17.0.2
### react-waypoint: 9.0.3

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.