Skip to content

Commit

Permalink
Carousel: return early in _slide method
Browse files Browse the repository at this point in the history
  • Loading branch information
GeoSot authored and XhmikosR committed Mar 9, 2022
1 parent d4e87d2 commit 7e5a801
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions js/src/carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,10 @@ class Carousel extends BaseComponent {
}

_slide(order, element = null) {
if (this._isSliding) {
return
}

const activeElement = this._getActive()
const isNext = order === ORDER_NEXT
const nextElement = element || getNextActiveElement(this._getItems(), activeElement, isNext, this._config.wrap)
Expand All @@ -305,10 +309,6 @@ class Carousel extends BaseComponent {
return
}

if (this._isSliding) {
return
}

const nextElementIndex = this._getItemIndex(nextElement)

const triggerEvent = eventName => {
Expand Down

0 comments on commit 7e5a801

Please sign in to comment.