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

Carousel pagination markers do not change when items are swiped on mobile #65

Open
gjrogala opened this issue Aug 2, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@gjrogala
Copy link

gjrogala commented Aug 2, 2024

Describe the bug

When viewed on a mobile device (only tested iPhones) the pagination markers below the slider do not change accordingly when carousel items are swiped.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Carousel documentation page on WebAwesome Alpha
  2. Click on 'Edit' for any Carousel example that has pagination and mouse dragging enables and open the Codepen page on mobile
  3. Swipe the items

Demo

Here is my demo (open on mobile)
https://codepen.io/grzegorz-rogala/pen/LYKxOZR/0b4177bc561512ddcf1bb9dda38d8e60

Browser / OS

  • OS: Mac
  • Browser: Mobile Safari, Mobile Chrome and Mobile Firefox
  • Browser version: 17.6 same as the iOS
@gjrogala gjrogala added the bug Something isn't working label Aug 2, 2024
@claviska
Copy link
Member

I reduced this and it looks like it's behaving correctly.

https://codepen.io/claviska/pen/poMaZXL?editors=1100

Note that the following attributes are set, which I think it causing confusion:

<wa-carousel ... slides-per-page="3" slides-per-move="3">

Slides per page will show three per "slide" and slides per move determines how many slides the carousel moves with previous/next. In its current state, you need to drag three slides for the dot to change. However, if you set slides-per-move to 1 you'll notice it update even when you slide just one.

If I'm missing something, please let me know and I'll reopen for further investigation.

@gjrogala
Copy link
Author

gjrogala commented Oct 28, 2024

It works when you use the navigation buttons but when I swipe my finger across the slides from left to right (as mouse dragging is enabled), the marker does not change for me.

I tested on iPhone SE with iOS 17.6.1 across Safari, Chrome and Firefox and the result persists.

@claviska
Copy link
Member

when I swipe my finger across the slides from left to right (as mouse dragging is enabled

Ah, this is what confused me. Mouse dragging is actually handled in a separate code path because touch "just works" due to the use of scroll snap. It looks like that is working fine.

However, swiping no longer causes the navigation dots to update.

Thanks for clarifying!

@claviska claviska reopened this Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants