-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Feature Request: Add prevDisabled
and nextDisabled
#28
Comments
Hi @jasongerbes -- yeah I think that makes sense as it is a little annoying having to read that logic so often. I think returning const hasPreviousPage = activePageIndex > 0;
const hasNextPage = activePageIndex < pages.length - 1; Happy to accept a PR for it 👍 |
Hey @richardscarrott, thanks for that. I'll get a PR up shortly. Regarding naming, would you prefer:
I feel 2 or 3 would be more consistent with the naming of the |
Yeah, let’s go with 2 🙏 |
@richardscarrott, PR #29 is ready for your review |
Rendering previous and next buttons current requires using the
activePageIndex
andpages.length
to determine whether each button should be disabled. For instance:As a nice-to-have API improvement,
useSnapCarousel
could useactivePageIndex
andpages.length
internally to includeprevDisabled
andnextDisabled
properties in theSnapCarouselResult
:I'd be happy to create a PR for this feature
The text was updated successfully, but these errors were encountered: