diff options
| author | Rohit Sharma <[email protected]> | 2021-01-18 12:15:56 +0530 |
|---|---|---|
| committer | XhmikosR <[email protected]> | 2021-01-28 23:32:24 +0200 |
| commit | e79c8f3489527d7f5eef2bb3cf14856f26c49871 (patch) | |
| tree | 4999e0960482ee07128521875ad8769234151546 /js | |
| parent | a882614c455fa0fb3014bd474df382e085263f56 (diff) | |
| download | bootstrap-e79c8f3489527d7f5eef2bb3cf14856f26c49871.tar.xz bootstrap-e79c8f3489527d7f5eef2bb3cf14856f26c49871.zip | |
Just find the active indicator
Diffstat (limited to 'js')
| -rw-r--r-- | js/src/carousel.js | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/js/src/carousel.js b/js/src/carousel.js index 9fd8aae3d..2874e6e95 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) |
