Skip to content

Commit

Permalink
fix(accordion): remove inactive classes before adding active classes …
Browse files Browse the repository at this point in the history
…when showing an accordion item
  • Loading branch information
Angelo Karugo committed Dec 17, 2024
1 parent b51d64a commit 0d65847
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/accordion/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ class Accordion implements AccordionInterface {
}

// show active item
item.triggerEl.classList.add(...this._options.activeClasses.split(' '));
item.triggerEl.classList.remove(
...this._options.inactiveClasses.split(' ')
);
item.triggerEl.classList.add(...this._options.activeClasses.split(' '));
item.triggerEl.setAttribute('aria-expanded', 'true');
item.targetEl.classList.remove('hidden');
item.active = true;
Expand Down

0 comments on commit 0d65847

Please sign in to comment.