Nested tabs are not working

Created on 28 March 2025, 11 days ago

Problem/Motivation

I have a set of tabs with ajax enabled. The content of one of the tabs is a block of another quicktabs instance.

When clicking on the tabs of the loaded 2nd instance, the content is loaded, but the tab is not revealed.

I have a small js patch incoming that fixes this.

πŸ› Bug report
Status

Active

Version

4.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States loze Los Angeles

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @loze
  • πŸ‡ΊπŸ‡ΈUnited States loze Los Angeles

    The reason it is failing is from this behavior:

    Drupal.behaviors.quicktabs = {
        attach(context, settings) {
          $(once('quicktabs-wrapper', 'div.quicktabs-wrapper', context)).each(
            function () {
              const el = $(this);
              Drupal.quicktabs.prepare(el);
            },
          );
        },
      };
    

    The nested content is 'div.quicktabs-wrapper', so its not checked here in the context. We either need to wrap the content in another div container, or remove the context from the once statement so it checks everything.

    My MR removes the context since that was the simplest, but not sure which approach you would rather.

  • Pipeline finished with Success
    11 days ago
    Total: 329s
    #459458
Production build 0.71.5 2024