From: Rohit Sharma Date: Mon, 18 Jan 2021 06:45:56 +0000 (+0530) Subject: Just find the active indicator X-Git-Tag: v5.0.0-beta2~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e79c8f3489527d7f5eef2bb3cf14856f26c49871;p=thirdparty%2Fbootstrap.git Just find the active indicator --- diff --git a/js/src/carousel.js b/js/src/carousel.js index 9fd8aae3db..2874e6e95d 100644 --- a/js/src/carousel.js +++ b/js/src/carousel.js @@ -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)