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.

Tabs: All tab menu items set to active/current on page load

  • Using the Tabs block, I have 5 tabs set up. When the page loads, all five tab menu items are being given the .gb-block-is-current class, which means they are all styled as if they are the current/active tab.

    This resets and works properly as soon as you click on any other tab beside the first one.

    NOTE: I did rename the HTML ID for each tab item container so that I could use easy to remember hashes in the URL to link directly to a tab. I saw those had dynamically inserted IDs by default, so I’m not sure if doing this messed something up.

    Including live site in private info.

  • Hi Dave,

    That’s odd. Do you happen to have any custom functions that could be causing this behavior? If not, try deactivating all plugins except GP Premium, GB, and GB Pro to see if it’s a plugin conflict.

    Regarding the HTML ID – there should be no issue changing the default IDs as long as each one is unique.

  • Thanks for confirming HTML IDs 👍

    I deactivated all plugins except those 3 and the issue persists. All my custom functions were in the FluentSnippets plugin, which I deactivated.

    It’s interesting that the aria-selected attribute is set to false on all but the first tab, which appears to be correct. So that part is working. But what is telling it to add the .gb-block-is-current class?

    Here’s a screenshot just for reference.

  • When you added more tab items, did you duplicate the existing tab item or did you use the specific Add tab item button?

    If you used the duplicate method, then your tab structure is broken, you will need to rebuild the tabs and use the proper way to add tab items.

  • I duplicated them. That was the issue. I recreated tab items 2-5 using the “add tab item” button and that fixed it. Thanks Ying!

  • Glad to hear that 🙂

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