Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onEnter and onLeave horizontal is triggered on vertical scroll #351

Open
ghost opened this issue Apr 17, 2021 · 0 comments
Open

onEnter and onLeave horizontal is triggered on vertical scroll #351

ghost opened this issue Apr 17, 2021 · 0 comments

Comments

@ghost
Copy link

ghost commented Apr 17, 2021

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

<Waypoint
            horizontal={true}
            onEnter={_handleWaypointEnter}
            onLeave={_handleWaypointLeave}
          />

Handlers

const _handleWaypointEnter = () => {
    setInView(true);
    setChangeCount(changeCount + 1);
  };
  const _handleWaypointLeave = () => {
    setInView(false);
    setChangeCount(changeCount + 1);
  };

React: 17.0.2

react-waypoint: 9.0.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants