Skip to content

Commit 314b4ee

Browse files
committed
fix: fix initial state for Accordion without any panel active
When going back in history, the Accordion without any panel active is still considered as in its "initial state".
1 parent 5ea51f3 commit 314b4ee

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

js/foundation.accordion.js

+5
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ class Accordion extends Plugin {
6161
});
6262

6363
var $initActive = this.$element.find('.is-active').children('[data-tab-content]');
64+
// Remember if we already set up the initial state of the Accordion as it
65+
// gives additional privileges in the Accordion methods (like opening
66+
// multiple panels even with the "multiExpand" option is disabled)
67+
// TODO: refactor and clean this
6468
this.firstTimeInit = true;
6569
if ($initActive.length) {
6670
// Save up the initial hash to return to it later when going back in history
@@ -113,6 +117,7 @@ class Accordion extends Plugin {
113117
}
114118

115119
this._events();
120+
this.firstTimeInit = false;
116121
}
117122

118123
/**

0 commit comments

Comments
 (0)