Home Forums Community Forum FAQ toggle only for 1 second

Tagged: , , , , ,

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • homepeage@njf.de
    Participant
    Post count: 1

    after the last update we have the Problem that by toggle down a faq it toogled only for 1 second.

    Has anyone a fix or patch or the Same Problem?

    exp. https://faq.njf.de/

    olivebranchdigital
    Participant
    Post 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.

    marklchaves
    Participant
    Post count: 816

    Hi @homepeagenjf-de,

    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 collapse or show not both at the same time. Like this.

    
    <!-- Collapsed or hidden content. -->
    <div id="collapse-1-38" class="panel-collapse collapse" style="">
    

    Or

    
    <!-- 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 collapse class remains and the show class toggles fine (removed/added). It’s like the event handler is forgetting to toggle the collapse class 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 Organised
    Participant
    Post count: 2

    I have the same issue but only on mobile for this site: https://foreverflowering.com.au – all the FAQ open for a second and close up. Can’t seem to solve it.

    COENCompositeWood
    Participant
    Post 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.

    https://www.coen.com.au/about/frequently-asked-questions/

    COENCompositeWood
    Participant
    Post count: 2

    Turns out it was a plugin conflict with the number counter I had!

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.