Manage Carousel first/last slide click cases
This commit is contained in:
@@ -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') {
|
||||
|
||||
Reference in New Issue
Block a user