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 inaccurate tabs, add page index change callback #3

Merged
merged 11 commits into from
Jul 19, 2024

Conversation

roginfarrer
Copy link
Owner

@roginfarrer roginfarrer commented Jul 17, 2024

Unreleased

  • Carousel, CarouselButton, CarouselScroller, CarouselItem, CarouselTabs, CarouselTab, CarouselAutoplayControl now forward the refs of their outer elements.

  • useCarousel and Carousel now support a new prop onActivePageIndexChange. This prop accepts a function that's called with the new activePageIndex when it's changed. Fixes Support for getting active page index #1.

    <Carousel
      onActivePageIndexChange={(args) => {
        setActivePageIndex(args.index);
      }}
    />
  • Fixed a bug where having a number of items not divisible by itemsPerPage would not update the activePageIndex to the last page as expected. (e.g., if there are 8 items and the itemsPerPage option is set to 3, the tabs would never reflect scrolling to the last page.) Fixes ItemsPerPage bug  #2.

  • Fixed a bug where mouse dragging was jittery and buggy between the first and last items when mouseDragging and loop="infinite" were set.

Copy link

vercel bot commented Jul 17, 2024

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

Name Status Preview Comments Updated (UTC)
react-aria-carousel ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 19, 2024 10:13pm

@roginfarrer roginfarrer merged commit b374cba into main Jul 19, 2024
6 checks passed
@roginfarrer roginfarrer deleted the fix-uneven-items branch July 19, 2024 22:14
@danjambur
Copy link

thanks for fixing the bug @roginfarrer!

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.

ItemsPerPage bug Support for getting active page index
2 participants