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

CR: In loop mode, fail to delete the last element #6477

Closed
6 tasks done
huangyingzheng opened this issue Mar 10, 2023 · 1 comment
Closed
6 tasks done

CR: In loop mode, fail to delete the last element #6477

huangyingzheng opened this issue Mar 10, 2023 · 1 comment
Labels

Comments

@huangyingzheng
Copy link

huangyingzheng commented Mar 10, 2023

Check that this is really a bug

  • I confirm

Reproduction link

https://codesandbox.io/s/laughing-elgamal-xhrp19?file=/src/App.js

Bug description

swiper: 9.1.0
react: 18.2.0
link: https://codesandbox.io/s/laughing-elgamal-xhrp19?file=/src/App.js
Fail to delete the last element in loop mode
When I click the button below character 9 , the purpose of the button is to delete the last element. The current view will slide to right.

Expected Behavior

No response

Actual Behavior

No response

Swiper version

9.1.0

Platform/Target and Browser Versions

Chrome

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
@huangyingzheng
Copy link
Author

huangyingzheng commented Mar 11, 2023

Please check here
https://github.com/nolimits4web/swiper/blob/master/src/core/loop/loopDestroy.js#L8
I think, the slides here is a closure, because using the destructuring assignment , event though the program executes swiper.recalcSlides(); .slides has not changed.
Probably, using swiper.slides.forEach would be fine.
25f839fb23167bbe3306225db8da2ae

@huangyingzheng huangyingzheng changed the title In loop mode, fail to delete the last element CR: In loop mode, fail to delete the last element Mar 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant