From 977deafb576130acac5a9589ed1a45966a7337bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Mon, 15 Jun 2026 16:14:57 +0200 Subject: [PATCH] fix: reset faq search with every new search, improve legibility closes #86965w98m --- .../Private/Assets/js/controllers/faq_controller.js | 9 ++++----- .../ext/ep_theme/Resources/Private/Partials/Faq.html | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/faq_controller.js b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/faq_controller.js index 130c2afe..baa206a7 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/faq_controller.js +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/controllers/faq_controller.js @@ -21,11 +21,10 @@ export default class extends Controller { } const pattern = new RegExp(value, 'i') this.entryTargets.forEach(entry => { - const question = entry.childNodes[0].textContent - const answer = entry.childNodes[1].textContent - if (!question.match(pattern) && !answer.match(pattern)) { - entry.classList.add('hidden') - } + const question = entry.querySelector('button span').textContent + const answer = entry.querySelector('[data-rte-content]').textContent + const matches = question.match(pattern) || answer.match(pattern) + entry.classList.toggle('hidden', !matches) }) } } diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Faq.html b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Faq.html index 29ba758b..5a6b33da 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Faq.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Partials/Faq.html @@ -5,7 +5,7 @@
-
+
@@ -28,7 +28,7 @@ data-faq-target="entry">