Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Animation of Accordion

  • Hi there

    if in a accordion you set the setting that only one Accordion item is allowed to be open the Animation jumps quite strange.

    In our view on click on another accordion item it should scroll to the item you want to open and not somewhere else.

    Thanks
    Brian

  • Hi Brian,

    The issue stems from the closing accordion, particularly if it’s longer than the accordions that come after it. It’s an inherent issue with accordion, but we are looking at ways to improve that.

    For now, the way to resolve this is to enable the Keep Multiple Items open under Accordion Block Settings. Reference: https://docs.generateblocks.com/article/accordion-overview/#block-settings-–-accordion

  • Thanks Fernando for your feedback. is there any github issue or pullrequest we can follow and help testing?

  • Hi there,

    GB Pro is developed under a Private GitHub, so we don’t have that issue open to the public.
    But we have this topic marked for that Improvement, so we will try and circle back here once there is a beta offering available.

  • Was just searching the forum for solutions to this exact issue. Found a few threads about it so glad to know that it’s being worked on.

  • FYI, there was one workaround script, that would require some testing. See my reply here for the script:

    https://generate.support/topic/mobile-accordions-throwing-users-to-bottom-of-page/#post-2722

    Its not perfect by any means, but as we’re dealing with an inherent issue with auto closing accordions, i am not sure there will ever be a perfect solution.

  • Thanks for the pointing me to that thread, David. Thought there might be some creative workarounds being shared. I’m no developer so I don’t know what I don’t know about what’s possible, but just thinking out loud, I was wondering if it might be possible to create a solution using anchors. Where on the ‘gb-accordion__icon-open’ click, that action links/anchors to the accordion gb-button-text? I’ll have to test my theory, but you would know better than I if something like that is possible.

  • The main hurdle to overcome is the resizing of the document when accordions are open / closed.
    This throws the scroll position out the window. So the browsers native function to jump to a link has to be delayed before firing otherwise it scrolls to where that anchor was before resizing occurred.

    Its what that script tries to address, by observing changes to an accordion. Waiting 500ms for the browser to resize the document, and then scrolling the target accordion to the top of the viewport.

    If any one comes up with a super smart solution i would be happy to see it 🙂

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