diff --git a/blocks/accordion/accordion.css b/blocks/accordion/accordion.css index aa152dfe..b1d7dc62 100644 --- a/blocks/accordion/accordion.css +++ b/blocks/accordion/accordion.css @@ -75,7 +75,7 @@ main .accordion.faq-accordion .faq-answer { overflow: hidden; font-size: 16px; max-height: 0; - transition: all 0.5s ease-in-out; + transition: all 0.3s ease-in-out; text-align: left; } diff --git a/blocks/accordion/accordion.js b/blocks/accordion/accordion.js index ffc8317b..54a450ca 100644 --- a/blocks/accordion/accordion.js +++ b/blocks/accordion/accordion.js @@ -63,7 +63,10 @@ export default function decorate(block) { const openfaq = block.querySelector('.faq-question.active'); if (openfaq && !currentFaq) { openfaq.classList.toggle('active'); - openfaq.nextElementSibling.classList.toggle('active'); + openfaq.nextElementSibling.style.maxHeight = 0; + setTimeout(() => { + openfaq.nextElementSibling.classList.toggle('active'); + }, 300); } const faqAnswer = e.currentTarget.nextElementSibling; e.currentTarget.classList.toggle('active');