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

afterChange doesn't fire with lazyLoading: 'ondemand' #1645

Open
theexplay opened this issue Oct 1, 2019 · 3 comments
Open

afterChange doesn't fire with lazyLoading: 'ondemand' #1645

theexplay opened this issue Oct 1, 2019 · 3 comments

Comments

@theexplay
Copy link

theexplay commented Oct 1, 2019

CodeSandBox: https://codesandbox.io/s/react-typescript-sq6ih

When i'm using lazyLoading option with 'ondemand' value, afterChange function doesn't fire. It's easy to reproduce by fast clicking on the "next arrow". But if all images already loaded bug will not reproduce (for example if u will press prev arrow).

Steps to reproduce:

  1. After render page, just press on next arrow fast
  2. You will see, that beforeChange fires every time, but afterChange sometimes doesn't fire
  3. Watch on the console

Even if u already scrolled to last slide, afterChange could still doesn't fire, looks like a bug..

ezgif-1-0509b3f58284

p.s. sry for my eng.

@theexplay
Copy link
Author

any news?

@AndreyYurashevich
Copy link

Same issue for me.

Seems like it's caused by the "load" event handlers for lazy-loaded images set in checkImagesLoad. The handlers call onWindowResized which in turn clears timeout handle this.animationEndCallback which is responsible for triggering afterChange.

@GuyPaddock
Copy link

GuyPaddock commented Dec 28, 2020

Also see #1262 and its associated PR.

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

3 participants