Manage Carousel first/last slide click cases

This commit is contained in:
2021-11-28 23:27:44 +01:00
parent cf1ba3efec
commit e8843409ce

View File

@@ -54,7 +54,12 @@
const handleArrowClick = () => {
if (!carousel.clickAllowed()) return
// TODO: Clicking should also define arrowDirection? Can click without moving and won't change direction
// Define direction
if (isFirstSlide) {
arrowDirection = 'next'
} else if (isLastSlide) {
arrowDirection = 'prev'
}
// Click only if carousel if being dragged
if (arrowDirection === 'prev') {