Skip to content

fix: prevent currentSlide from going out of bounds of totalSlides #240

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

Merged
merged 2 commits into from
Feb 11, 2020

Conversation

seleb
Copy link
Contributor

@seleb seleb commented Feb 11, 2020

What:

Prevent currentSlide from going out of bounds of totalSlides.

Why:

It's possible for a component to dynamically change the number of slides. If the number of slides is reduced such that currentSlide is past totalSlides, it results in a blank view.

How:

On CarouselProviders update, currentSlide is being constrained to totalSlides - 1 (i.e. the last slide).

Checklist:

  • [ ] Documentation added/updated N/A, bugfix
  • [ ] Typescript definitions updated N/A, no type changes
  • Tests added and passing
  • Ready to be merged

@mrbinky3000 mrbinky3000 merged commit 30e3110 into express-labs:master Feb 11, 2020
@bcarroll22
Copy link
Contributor

🎉 This PR is included in version 1.25.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@seleb seleb deleted the bug/currentslide-oob branch February 11, 2020 19:41
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 this pull request may close these issues.

3 participants