Problem/Motivation
If a form includes nested horizontal tabs (e.g. paragraph tabs within node tabs), the child tabs break the default open state of the parent ones.
This issue only surfaces in edge cases when the default tab is configured to be something other than the 1st tab.
Steps to reproduce
- Install the Field Group and Paragraphs modules.
- Create a Paragraph type with two text fields.
- Go to the Paragraph type's Manage Form Display page:
- Add a Tabs group (horizontal), with two Tab sub-groups.
- Place one text field under each tab.
- Create a new Content type with one Paragraph field that allows only the paragraph type created above.
- Go to the Content type's Manage Form Display page:
- Add a Tabs group (horizontal), with two Tab sub-groups.
- Place the Title field under the 1st tab, and the Paragraph field under the 2nd.
- Set the 2nd tab to be open by default
- Open the node add form for that content type.
Observed behavior: The 1st tab is open by default, not the configured 2nd tab.
Proposed resolution
Update formatters/tabs/horizontal-tabs.js to use a stricter selector, so nested tab structures don't interfere with the parent's default state. Change :hidden.horizontal-tabs-active-tab to > :hidden.horizontal-tabs-active-tab.
Remaining tasks
Review. Test.
User interface changes
None.
API changes
None.
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | field_group_horizontal_tabs.png | 55.27 KB | bember |
| #4 | Screenshot 2025-07-22 at 12.51.33 PM.png | 258.31 KB | sandeep_k |
Issue fork field_group-3535860
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
bember commentedMR is ready for review.
Comment #4
sandeep_k commentedI tried to reproduce this by following the steps as shared above, but was unable to do so. I checked this on- Drupal Version 10.3.1-dev.
Let me know if I have missed any steps here.
Comment #5
bember commentedHi @sandeep_k, thanks for testing. To clarify, the issue is about horizontal tabs (see the attached example).
Comment #6
anybodyCan we have a (broken without fix) test for this maybe? That would be great!
Comment #7
benstallings commentedpending requested tests
Comment #8
benstallings commentedComment #9
benstallings commentedComment #10
anybodyThanks @benstallings!!
@bember or anyone else could you please test manually that this issue is resolved?
@benstallings I guess you already were able to reproduce this manually and tested the fix?
Comment #11
anybodyComment #12
anybody