Manage Carousel first/last slide click cases
This commit is contained in:
@@ -54,7 +54,12 @@
|
|||||||
const handleArrowClick = () => {
|
const handleArrowClick = () => {
|
||||||
if (!carousel.clickAllowed()) return
|
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
|
// Click only if carousel if being dragged
|
||||||
if (arrowDirection === 'prev') {
|
if (arrowDirection === 'prev') {
|
||||||
|
|||||||
Reference in New Issue
Block a user