From 572611aa66e4bdcb22cb5619e890299f2618d296 Mon Sep 17 00:00:00 2001 From: Keryan SANIE Date: Wed, 16 Oct 2024 19:35:57 +0200 Subject: [PATCH] =?UTF-8?q?fix(accordion):=20ouverture=20initiale=20des=20?= =?UTF-8?q?accord=C3=A9ons=20d=C3=A9group=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/script/disclosure/disclosures-group.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/core/script/disclosure/disclosures-group.js b/src/core/script/disclosure/disclosures-group.js index e487ccbd1..25918a189 100644 --- a/src/core/script/disclosure/disclosures-group.js +++ b/src/core/script/disclosure/disclosures-group.js @@ -82,6 +82,17 @@ class DisclosuresGroup extends Instance { this.getMembers(); this._isRetrieving = false; this._hasRetrieved = true; + + if (!this.isGrouped) { + for (let i = 0; i < this.length; i++) { + const member = this.members[i]; + if (member.isInitiallyDisclosed) { + member.disclose(true); + } + } + return; + } + if (this.hash) { for (let i = 0; i < this.length; i++) { const member = this.members[i]; @@ -106,7 +117,9 @@ class DisclosuresGroup extends Instance { update () { this.getMembers(); - if (this._hasRetrieved) this.getIndex(); + if (this._hasRetrieved) { + if (this.isGrouped) this.getIndex(); + } } get members () { @@ -143,7 +156,7 @@ class DisclosuresGroup extends Instance { if (value === i) { if (!member.isDisclosed) member.disclose(true); } else { - if ((this.isGrouped || !this.canUngroup) && member.isDisclosed) member.conceal(true); + if ((this.isGrouped || !this.canUngroup) && member.isDisclosed !== false) member.conceal(true); } } this.apply();