When tabs are set to horizontal with Bootstrap theme, the labels of the tabs aren't on the actual tabs.

See example image where 3 tabs are being used but the tab label (Where) only appears inside once the tab is opened.

Each horizontal tab has a vertical tab nested within it and that vertical tab has the label on it which should be on the horizontal tab.

I discovered this by setting tab's default states to closed. So you click on the horizontal tab and then click on the label inside and that tab animates vertically as it opens.

screenshot

Comments

the_glitch created an issue. See original summary.

the_glitch’s picture

Title: Horizontal tab names missing when using Bootstap theme » Horizontal tab labels are missing when using Bootstap theme
Issue summary: View changes
abaier’s picture

We have noticed this Bug also, while checking out core 8.9.x-dev. The titles of the tabs seem to be missing in the markup.

fg bug 01

fg bug 02

abaier’s picture

Tracked this down a bit. The tabs still render as expected using the Claro theme, but not in Seven anymore.

The Seven theme in core 8.9.x-dev added/will add a <span> element around the title in <summary>

/* File: /core/themes/seven/templates/details.html.twig */

     <summary{{ summary_attributes.addClass(summary_classes) }}>
-      {{- title -}}
+      <span>{{ title }}</span>
     </summary>

This seems to break the following line in '/modules/field_group/formatters/tabs/horizontal-tabs.js':

var summaryElement = $this.find('> summary .details-title');

If I remove the span from Seven's template OR replace '.details-title' with 'span' inside the function the tabs will be rendered correctly.

var summaryElement = $this.find('> summary span');

Could this break things in another place? I am also not sure where this issue belongs, so help would be highly appreciated.

Thanks!

abaier’s picture

Title: Horizontal tab labels are missing when using Bootstap theme » Titles are missing in horizontal tabs
Related issues: +#2980304: Seven theme's details/summary focus style is broken/missing in some browsers.

Adding the issue where this new <span> was implemented.

gmercer’s picture

StatusFileSize
new694 bytes

I've added the following patch.

the_glitch’s picture

Patch #6 applied but doesn't work. Field names are still only visible after going into the tab's page, not on the tab itself.

danharper’s picture

Patch doesn't work for me either using seven theme. My content edit screen is fairly unusable at this point.

huzooka’s picture

Status: Active » Needs review
StatusFileSize
new931 bytes

If anyone could check this with ie11, that would be great.

the_glitch’s picture

Same outcome as test #7
Patch #9 applied but doesn't work. Field names are still only visible after going into the tab's page, not on the tab itself.

huzooka’s picture

Assigned: Unassigned » huzooka
Status: Needs review » Needs work
huzooka’s picture

Assigned: huzooka » Unassigned
Status: Needs work » Needs review
StatusFileSize
new15.21 KB
new14.3 KB

Added a Nightwatch test (so at least Chrome should be fine).
The interdiff is the test-only patch itself.

huzooka’s picture

@the_glitch, what browser do you use?

the_glitch’s picture

Patch #12 doesn't work either.

I'm using chrome and firefox

What I've just noticed is that it seems that each horizontal tab has a vertical tab nested within it and that vertical tab has the label on it which should be on the horizontal tab.

I discovered this by setting tab's default states to closed. So you click on the horizontal tab and then click on the label (vertical tab) inside and the tab animates vertically as it opens.

marcoka’s picture

I had a similar problem with Drupal 8.9.0. final. But it is realted to the JS and the Jquery update on 8.9.0

#3145717: Empty tab labels Drupal 8.9.0

the_glitch’s picture

Yes I believe the problem is because the actual tab is nested inside the horizontal tab and which means the label is nested causing its label to be hidden until the horizontal tab is opened.

The patch in the issue you mentioned in comment #15 also doesn't fix this issue.

huzooka’s picture

Title: Titles are missing in horizontal tabs » Titles are missing in horizontal tabs on Bootstrap theme
huzooka’s picture

Status: Needs review » Active
Related issues: +#3145717: Empty tab labels Drupal 8.9.0

The attached patches aren't fixing the issue (which happens on the Bootstrap theme, I guess with version 8.x-3.x).

Setting back to active, and added #3145717: Empty tab labels Drupal 8.9.0 as related issue. I guess that one should be fixed first.

the_glitch’s picture

Issue summary: View changes
thomwilhelm’s picture

Similar to @the_glitch we are using Horizontal tabs and the seven admin theme. I've tried patches from this ticket as well as from #3145717 but no luck so far.

Updated: Ignore that, I've upgraded to field_group 3.1 and Drupal 8.9.0 and the tabs are working correctly. Not sure what I did wrong but I can't replicate anymore.

jelle_s’s picture

Can confirm, field_group 3.1 fixes it.

the_glitch’s picture

I can confirm that field_group 3.1 does not fix it

kplatis’s picture

I see the same bug for Field Group 3.0 and Adminimal Theme

marcoka’s picture

@platico You should check it with 3.1 not with an older version.
I also use adminimal and the patch has fixed it here. I use chrome/vivaldi

jelle_s’s picture

@platico try Field Group 3.1 first, it seems to fix it for some (not all, see #22) people.

the_glitch’s picture

@ThomWilhelm
Do your horizontal tabs now have the labels ON the tabs or inside once you click on them?

kplatis’s picture

I confirm that it is solved when using Adminimal theme and Field Group version 3.1

the_glitch’s picture

@platico and @marcoka
This issue's bug is about Bootstrap, not Adminimal.

marcoka’s picture

@the_glitch i also use bootstrap as a frontend. You mean botstrap as a backend?

I use:
- frontend radix = bootstrap 4
- backend adminimal/seven
- drupal 8.9.1
- latest field_groups module

the_glitch’s picture

@marcoka Pretty much the same setup but Bootstrap 3.2

frob’s picture

This sounds like a bootstrap 3.2 issue. I got past this by overriding the template in my theme to add .details-title as a class on the span. Better fix my theme than to force a bespoke fix in a contrib module.

rodrigoaguilera’s picture

Weird.
I am using seven theme and I had to tweak the template to add the .details-title to the span

mrpauldriver’s picture

Title: Titles are missing in horizontal tabs on Bootstrap theme » Titles are missing in horizontal tabs

I am also seeing this with Adminimal. Switching to Claro for now

blacklabel_tom’s picture

I can confirm upgrading to 3.1 with core 8.9.5 works for me with the Seven admin theme.

Cheers

Tom

meena.bisht’s picture

Assigned: Unassigned » meena.bisht
sonvir249’s picture

Assigned: meena.bisht » sonvir249
benroy’s picture

I confirm to upgrading to 3.1 with core 8.9.8 works for me with the adminimal admin theme.
Thks,

gustavowal’s picture

Confirming on 8.9.9 the patch fixes the issue.

FleetAdmiralButter’s picture

Updating to 3.1 on Drupal 8.9.11 fixed the issue for us when using the seven theme!

the_glitch’s picture

@gustavowal does it work for bootstrap?

eric.chenchao’s picture

I think this is duplicate to #3145717: Empty tab labels Drupal 8.9.0 and probably can be closed. The fix in the other ticket is merged in 3.0

sim_1’s picture

I'm no longer seeing this issue in D9 with field_group 8.x-3.2 with seven admin theme. I agree that it can be marked as fixed.

nils.destoop’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.