1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-20 04:11:39 +02:00

Just find the active indicator

This commit is contained in:
Rohit Sharma
2021-01-18 12:15:56 +05:30
committed by XhmikosR
parent a882614c45
commit e79c8f3489

View File

@@ -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)