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

Controller module + loop=true causes destroy() to crash #6491

Closed
6 tasks done
OscarVantagePOS opened this issue Mar 15, 2023 · 2 comments · Fixed by #6501
Closed
6 tasks done

Controller module + loop=true causes destroy() to crash #6491

OscarVantagePOS opened this issue Mar 15, 2023 · 2 comments · Fixed by #6501
Labels

Comments

@OscarVantagePOS
Copy link

OscarVantagePOS commented Mar 15, 2023

Check that this is really a bug

  • I confirm

Reproduction link

https://codesandbox.io/p/sandbox/swiper-react-infinite-loop-forked-04uv5n?selection=%5B%7B%22endColumn%22%3A18%2C%22endLineNumber%22%3A51%2C%22startColumn%22%3A18%2C%22startLineNumber%22%3A51%7D%5D&file=%2Fsrc%2FApp.jsx

Bug description

I know this issue likely goes outside the bounds of React but since I only have reproduction case for React I thought I'd just put it here.

The issue is fairly simple in nature.
When using the Controller module and loop=true together the component crashes when unmounted.

Expected Behavior

No error thrown

Actual Behavior

An error is thrown

Swiper version

9.1.0 as well as 9.0.5

Platform/Target and Browser Versions

Test case in Chrome on windows. Error observed via Sentry in a multitude of browsers on both iOS and Android.

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
  • Make sure this is a Swiper issue and not a framework-specific issue

Would you like to open a PR for this bug?

  • I'm willing to open a PR
@OscarVantagePOS
Copy link
Author

@nolimits4web this still occurs in the reproduction example on the latest version of Swiper.
I forgot to mention that to make the error consistently occur, you need to Swipe over to a slide that's part of the loop feature (e.g swipe back one from the first slide slide forward until you hit the first slide again).

@Voidoz
Copy link
Contributor

Voidoz commented Mar 17, 2023

Hey, main account here.
Looking at the issue it looks like this is primarily connected to the controller system performing actions on controls without checking if they're still around. I'm gonna have a crack at fixing it the best I can but a closer look would be greatly appreciated as I'm not very familiar with the architecture of this library.

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

Successfully merging a pull request may close this issue.

2 participants