FormidableLabs / nuka-carousel

Small, fast, and accessibility-first React carousel library with an easily customizable UI and behavior to fit your brand and site.
https://commerce.nearform.com/open-source/nuka-carousel
Other
3.06k stars 593 forks source link

Feature: Additional render*Controls helpers #966

Closed fritz-c closed 2 years ago

fritz-c commented 2 years ago

Description

Adds nextDisabled, previousDisabled, and dotNavigationIndices to render*Controls callbacks to aid in the creation of custom controls.

Previously, library users would have to recreate the logic we already have inside the library for detecting when a next/prev button should be disabled, or for recreating the indices of the dots used for navigation. The logic for each of those is actually quite complex, with many edge cases, so it's very likely a library user would unintentionally introduce bugs into their program. By providing the values we use internally, they don't have to worry about recreating that logic.

Type of Change

How Has This Been Tested?

I used the newly provided values in the logic for rendering the default controls, so our existing test suite should catch any unexpected changes.

vercel[bot] commented 2 years ago

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

Name Status Preview Updated
nuka-carousel ✅ Ready (Inspect) Visit Preview Sep 7, 2022 at 4:20PM (UTC)