Skip to content

Commit 34aeaf3

Browse files
authored
Merge pull request #465 from warrenspe/collapsible-default
fix: class="active" non-accordion collapsible not opening by default
2 parents 23238db + 47db483 commit 34aeaf3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/collapsible.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ export class Collapsible extends Component<CollapsibleOptions> {
6868

6969
// Open active
7070
const activeBodies: HTMLElement[] = Array.from(this.el.querySelectorAll('li.active > .collapsible-body'));
71-
if (this.options.accordion)
71+
if (this.options.accordion) {
7272
if (activeBodies.length > 0) {
7373
// Accordion => open first active only
7474
this._setExpanded(activeBodies[0]);
7575
}
76-
else {
76+
} else {
7777
// Expandables => all active
7878
activeBodies.forEach(el => this._setExpanded(el));
7979
}

0 commit comments

Comments
 (0)