Skip to content

Commit

Permalink
Just find the active indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
rohit2sharma95 authored and XhmikosR committed Jan 28, 2021
1 parent f3de29f commit be40c85
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions js/src/carousel.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,12 +406,10 @@ class Carousel extends BaseComponent {

_setActiveIndicatorElement(element) {
if (this._indicatorsElement) {
const activeIndicators = SelectorEngine.find(SELECTOR_ACTIVE, this._indicatorsElement)
const activeIndicator = SelectorEngine.findOne(SELECTOR_ACTIVE, this._indicatorsElement)

for (let i = 0; i < activeIndicators.length; i++) {
activeIndicators[i].classList.remove(CLASS_NAME_ACTIVE)
activeIndicators[i].removeAttribute('aria-current')
}
activeIndicator.classList.remove(CLASS_NAME_ACTIVE)
activeIndicator.removeAttribute('aria-current')

const indicators = SelectorEngine.find(SELECTOR_INDICATOR, this._indicatorsElement)

Expand Down

0 comments on commit be40c85

Please sign in to comment.