From da3d2b2f27905b2c4ea35ccc6c85011f1988b74a Mon Sep 17 00:00:00 2001
From: Alice <alice.poggioli@hotmail.fr>
Date: Fri, 4 Oct 2019 12:30:56 +0200
Subject: [PATCH] fix the bug on the first step opened.

---
 src/scripts/coopstarter.js | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/scripts/coopstarter.js b/src/scripts/coopstarter.js
index 92ff5ec4..72888493 100644
--- a/src/scripts/coopstarter.js
+++ b/src/scripts/coopstarter.js
@@ -160,7 +160,13 @@ function manageAccordionByStep(){
 
   for (i = 0; i < acc.length; i++) {
     acc[i].addEventListener("click", function() {
-      this.classList.toggle("active");
+      if (this.classList.contains("active") == true){
+        this.classList.remove("active")
+        this.nextElementSibling.querySelector("sib-form + div").style.maxHeight = "0px";
+      }else{
+        this.classList.add("active")
+      }
+
       this.closest(".step").querySelector('nav').removeAttribute("hidden");
       refreshPagination()
 
-- 
GitLab