email@example.comParticipantSeptember 1, 2020 at 1:10 pmPost count: 2olivebranchdigitalParticipantNovember 2, 2020 at 8:50 pmPost count: 1
Does anyone have a fix for this faq toggle issue? I am experiencing the same problem. The FAQ box opens for just a second and then closes again.marklchavesParticipantNovember 3, 2020 at 1:18 amPost count: 873
Interesting problem. Thanks for sharing your link. Otherwise, I’d never be able to figure this one out.
I have 2 main observations:
1) The HTML for each FAQ content doesn’t seem right to me. Namely the class list. Here’s an example of the first FAQ.
<!-- Conflicting classes: collapse and show. --> <div id="collapse-1-38" class="panel-collapse collapse show" style="">
I’d expect it to have the class
shownot both at the same time. Like this.
<!-- Collapsed or hidden content. --> <div id="collapse-1-38" class="panel-collapse collapse" style="">
<!-- Opened or visible content. --> <div id="collapse-1-38" class="panel-collapse show" style="">
2) The event handler for the toggle headings doesn’t seem to be toggling the classes correctly. When I click on the toggle heading I can see a quick message “Collapsing”. But, then the
collapseclass remains and the
showclass toggles fine (removed/added). It’s like the event handler is forgetting to toggle the
collapseclass from the class list. But, this is kinda moot anyway because the class list is already in a conflicting state. It’s like double jeopardy.
At any rate, the event handlder code should look something like this.
/* Handle the toggle click event. */ faqElt.classList.toggle("collapse"); faqElt.classList.toggle("show");
I have a minimal reproducible example on CodePen if you’d like to see a live demo of my solution.
You might need to disable your plugins then re-enable 1-by-1 to rule out a plugin conflict. If it’s not a plugin conflict, you might need to escalate the issue.
Thanks!Frankly OrganisedParticipantOctober 20, 2021 at 3:57 amPost count: 3COENCompositeWoodParticipantNovember 24, 2021 at 1:25 amPost count: 2
I seem to be having the same issue.
I’m not overly experienced with this sort of thing so any help would be greatly appreciated!
Please see link below.
- You must be logged in to reply to this topic.