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

Fix carousel newActiveSlide calculation to account for slidesPerPage #2155

Merged
merged 2 commits into from
Sep 3, 2024

Conversation

LeanderG
Copy link
Contributor

@LeanderG LeanderG commented Aug 30, 2024

Navigating with the arrow key after reaching the last page leads to visual bugs with the pagination. This is because it tries to set newActiveSlide to a value too large if slidesPerPage is larger than 1.

Here is a video:
https://github.com/user-attachments/assets/6a1a7091-9ea7-46aa-ad2f-5ba1eee43536

After the fix:
https://github.com/user-attachments/assets/a59012bd-c4ec-416a-bbfc-d7d11d4a1497

I'm not sure if the change in line 466 is necessary.

Edit:
I also added a fix for #1989.

Copy link

vercel bot commented Aug 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
shoelace ✅ Ready (Inspect) Visit Preview Aug 31, 2024 9:57pm

We always need to scroll to the left most slide of the page. With rtl documents that's the last slide of the page.
Copy link
Member

@claviska claviska left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix! Looks good.

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

Successfully merging this pull request may close these issues.

2 participants