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 - initial page not working #2223

Open
Powerplex opened this issue Feb 5, 2025 · 0 comments
Open

Carousel - initial page not working #2223

Powerplex opened this issue Feb 5, 2025 · 0 comments

Comments

@Powerplex
Copy link

🐛 Bug report

Setting the initialPage is not working.

https://zagjs.com/components/react/carousel#setting-the-initial-slide

I tried to set page={2} like the doc shows, but it seems only the indicator group and prev/next triggers are aware of the prop.

The visible slide is still the first one (page 1).

If I click on "next" it will keep up from the right page, but the initial visible slide is incorrect.

💥 Steps to reproduce

  1. Try to slide left, you will see that you can't, this is because the carousel actually display the first page (scrollLeft = 0)
  2. If you then click on prev/next or dot indicator, it will pick up from the right page.

💻 Link to reproduction

Go to this stackblitz

🧐 Expected behavior

The carousel should show the slides matching the page I passed.

🌍 System information

Software Version(s)
Zag Version 0.82.1
Browser Chrome Version 132.0.6834.111
Operating System MacOs Sonoma 14.4.1 (23E224)
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

No branches or pull requests

1 participant