From 6a6b34e449ca87736c4ff6df3dc52e036bb843e9 Mon Sep 17 00:00:00 2001 From: Gowtami Date: Sat, 28 Oct 2023 22:10:27 +0530 Subject: [PATCH] fixed bug#47 --- blocks/accordion/accordion.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/blocks/accordion/accordion.js b/blocks/accordion/accordion.js index 435a685c..740dd312 100644 --- a/blocks/accordion/accordion.js +++ b/blocks/accordion/accordion.js @@ -5,7 +5,9 @@ export default function decorate(block) { faqRows.forEach((row) => { const faqQuestion = [...row.children][0]; const faqAnswer = [...row.children][1]; - + if (row.children[0].textContent === '') { + row.remove(); + } else { faqQuestion.classList.add('faq-question'); faqAnswer.classList.add('faq-answer'); @@ -29,5 +31,6 @@ export default function decorate(block) { faqQuestion.classList.remove('active'); faqAnswer.classList.remove('active'); faqAnswer.style.maxHeight = '0'; + } }); }