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

Waypoint doesn't trigger on list made with .map #359

Open
developdeez opened this issue Dec 3, 2021 · 2 comments
Open

Waypoint doesn't trigger on list made with .map #359

developdeez opened this issue Dec 3, 2021 · 2 comments

Comments

@developdeez
Copy link

A fellow dev and I have tried for hours now.

There seems to be no way to get Waypoint to work in components that create lists. We also tried putting the waypoint on the main page but it seems to think it's inside even after the list populates. I am now trying to force it with position absolute and same.

Here's the component for reference:

const EventsList: React.FC<IEventsList> = ({ events, handleEnd, lang, distanceMetric, loading, t, ad }) => {
  return (
    <div className='events-card-content'>
      <div className='container'>
        <div className='col-md-12'>
          <div className='row'>
            <div className='col-md-12'>
              <span className='head'>Events</span>
            </div>
            {events.map(event => (
              <EventCard upcomingEvents key={Math.random()} event={event} t={t} distanceMetric={distanceMetric} lang={lang} />
            ))}
            <ScrollUpButton />
          </div>
          <div style={{ padding: '0px', position: 'absolute', bottom: '30%' }}>
            <Waypoint onEnter={({ previousPosition, currentPosition }) => handleEnd({ previousPosition, currentPosition })} />
          </div>
          <div className='col-md-12'>
            {ad}
            <br />
            <div className='more-content-btn'>{loading ? <span>{t('Loading')}</span> : <span>{t('noevent')}</span>}</div>
          </div>
        </div>
      </div>
    </div>
  );
};

Im using 10.1.0 is this a known issue or am I doing something wrong.

@developdeez
Copy link
Author

bump

@trotzig
Copy link
Collaborator

trotzig commented Dec 13, 2021

It's hard to know what's going on without also knowing the css styles for the elements. The most likely thing is that the waypoint is consistently "visible" in the scrollable parent container. If you inspect the DOM and look for the react-waypoint div, where is it located?

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

2 participants