There is logic in /core/themes/seven/js/nav-tabs.js that if the height of a set of tabs is taller the first set of tabs, (primary tabs), to switch to a vertical or mobile view. This is great on mobile and tablet, but doesn't work well on large desktop, as you end up with very long full-width vertical tabs that push everything way below the fold. For example if you have many display modes, it pushes everything below the fold:

below the fold

In my case, when the secondary tabs are set to verity on a macbook retina on /admin/structure/types/manage/article/display, the ul.tabs.secondary these secondary tabs are 1375 pixels in height! (Labels changed to preserve anonymity).

I don't believe any special is required to recreate this. Just create a bunch of view modes.

Proposed Solution:

Update the logic to exclude the vertical tabs after a certain width.

Issue fork seven-3019851

Command icon 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

oknate created an issue. See original summary.

oknate’s picture

Issue summary: View changes
oknate’s picture

StatusFileSize
new1.31 KB
oknate’s picture

Title: secondary tabs shouldn't be set to vertical on desktop » Secondary tabs shouldn't be set to vertical on desktop
oknate’s picture

Title: Secondary tabs shouldn't be set to vertical on desktop » Tabs should remain horizontal on desktop above a certain width
oknate’s picture

StatusFileSize
new1.31 KB

Updated the logic.

oknate’s picture

StatusFileSize
new2.05 KB

Here's an updated version of patch #6 that adds flexbox to fix a spacing issue. I'm not a front-end specialist, so I'd love someone who is to see what they can do about making the tabs look better in these situations. Because I'm not setting random text, it looks more even that it normally does.

spacing issue

oknate’s picture

StatusFileSize
new33.32 KB
oknate’s picture

StatusFileSize
new32.16 KB

Here's a screenshot with flexbox added (patch #7).
with flexbox

oknate’s picture

Issue summary: View changes
oknate’s picture

Title: Tabs should remain horizontal on desktop above a certain width » Tabs should remain horizontal on desktop beyond a certain width

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

oknate’s picture

Status: Active » Needs work

Needs a reroll.

yogeshmpawar’s picture

Assigned: Unassigned » yogeshmpawar
yogeshmpawar’s picture

Assigned: yogeshmpawar » Unassigned
Status: Needs work » Needs review
StatusFileSize
new1.99 KB

Re-rolled the patch against 8.8.x branch.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

sulfikar_s’s picture

StatusFileSize
new1.92 KB

I've re-rolled the patch please review.

sulfikar_s’s picture

StatusFileSize
new2.02 KB

Fixed the custom commands. Please review.

sulfikar_s’s picture

StatusFileSize
new1.96 KB
new498 bytes

Corrected the flex-wrap position. Fixed the custom commands.

Also attaching the interdiff. Please review.

sulfikar_s’s picture

StatusFileSize
new1.96 KB

Corrected the last custom commands issue. Please review.

tanmaykadam’s picture

Assigned: Unassigned » tanmaykadam
tanmaykadam’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new157.32 KB
new238.55 KB

Verified and tested the patch in #22.
Patch applied successfully and looks good to me.

Testing Steps:
Add view modes
# Goto: /admin/structure/types/manage/page/display

Looks good to me.
Can be a move to RTBC
Please refer attached screenshots for before and after patch.

tanmaykadam’s picture

Assigned: tanmaykadam » Unassigned

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 22: 3019851-22.patch, failed testing. View results

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

rakhi soni’s picture

Status: Needs work » Needs review
StatusFileSize
new1.97 KB

Attached re-rolled against branch 9.5x,,
Kindly review patch.

sonam.chaturvedi’s picture

StatusFileSize
new58.96 KB
new84.75 KB

Verified and tested patch#22 on 9.5.x-dev. No need of re-rolled patch#30 as patch#22 works fine on 9.5.x-dev.

Test Steps:
1. Enable Seven theme
2. Add display > view modes for content
3. Goto: /admin/structure/types/manage/page/display

Test result:
Tabs remain horizontal on desktop beyond a certain width.

Before patch:
bef patch22 9.5

After patch:
after patch22 9.5

RTBC+1

bnjmnm’s picture

The reroll from @Rakhi Soni was not necessary (and added problems) and credit will not be granted. See my comment at #3088239: Revisions on relations are not loaded correctly resulting in wrong data in includes for how to determine if a reroll is needed.

longwave’s picture

Project: Drupal core » Seven
Version: 9.5.x-dev » 1.0.0-alpha1
Component: Seven theme » Code

The Seven theme has been removed from Drupal 10 core. I confirmed that this issue only affects Seven and no other themes included with Drupal core, so I am moving this to the contributed Seven project.

avpaderno’s picture

Version: 1.0.0-alpha1 » 1.0.x-dev
Status: Needs review » Needs work
Issue tags: +Needs merge request

immaculatexavier made their first commit to this issue’s fork.

avpaderno’s picture

Issue tags: -Needs merge request
avpaderno’s picture

seven-3019851/3019851- is 66 commits behind the target branch and it has conflicts. It is better to start again with seven-3019851/3019851-Tabs-should-remain-horizontal.

avpaderno changed the visibility of the branch 3019851- to hidden.

avpaderno changed the visibility of the branch 3019851-tabs-should-remain to hidden.

avpaderno’s picture

Assigned: Unassigned » avpaderno

avpaderno’s picture

avpaderno’s picture

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

  • avpaderno committed b02b34f5 on 1.0.x
    Issue #3019851: Tabs should remain horizontal on desktop beyond a...
avpaderno’s picture

  • avpaderno committed 153c30f2 on 2.0.x
    Issue #3019851: Tabs should remain horizontal on desktop beyond a...
avpaderno’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

kmitch’s picture

Hi,

I just installed v2.0.0-beta2 (in preparation for Drupal 11), and discovered that part of the fix for this issue seems to be causing a regression, at least for paragraph tabs that are designated as hidden with class "paragraph-tabs-hide".

In the "tabs.css" file, the "display: flex" rule for the selector ".is-horizontal .tabs" (lines 215-216 in the v2.0.0-beta2 version of tabs.css), is overriding the "display: none" rule for the selector ".paragraphs-tabs-wrapper .paragraphs-tabs-hide" from the paragraphs module's admin CSS stylesheet.

I have attached two screenshots that show the effect of the "display: flex" rule addition on a basic page's editing screen. In the "hidden-tabs-visible" screenshot (using v2.0.0-beta2 version of Seven), the "Content" and "Behavior" tabs are visible below the "Body" legend (the screenshot also shows the inspector highlighting the exact element that is affected and the rule that created a flex display). The other screenshot ("hidden-tabs-not-visible") shows the correct display of the "Body" legend without the two "paragraph-tabs-hide" elements visible.

It appears that the fix for this issue was never implemented for Seven v1.0.0, which presumably explains why this was never reported before (or else our configuration is unique). I'm not entirely certain the best way to address this, though, aside from perhaps amending the selector to become ".is-horizontal .tabs:not(.paragraphs-tabs-hide)"? This approach would need to be adjusted, though, if other admin elements also used a "*-hide" class name to suppress display. (Another approach would be to get the paragraphs maintainer to add an "!important" declaration to the paragraph-tabs-hide rule, but I suspect this issue is more theme- than module-dependent.

Sorry to raise this bug/problem long after this issue was closed!

-- Ken

avpaderno’s picture

Version: 2.0.0-beta2 » 1.0.x-dev
macdev_drupal’s picture

Thanks @Kmitch for documenting this. We can confirm a related regression on Drupal 11.3.3 with Seven 2.0.0-beta4 (admin theme: custom Subseven based on Seven).

Observed behavior:
- At viewport width >= 1182px, local tasks behave as expected.
- At viewport width <= 1181px, behavior breaks:
- either all tabs are shown (no "..." collapse trigger), or
- with local workaround patches, only a single tab is visible and the trigger area renders incorrectly.

This seems consistent with the flex-based horizontal tabs logic introduced as part of #3019851 and its interaction with hidden tab elements (e.g. `paragraphs-tabs-hide`).

In our setup, `.is-horizontal .tabs { display: flex; }` conflicts with hidden-tab expectations from Paragraphs UI styles, so hidden tabs can become visible and collapse logic becomes unstable.

So even though #3019851 is closed and merged in 2.x, there appears to be a remaining regression/edge case in D11-era admin layouts (possibly theme/CSS interaction dependent).

If helpful, we can provide:
- exact browser + zoom
- minimal repro route (/admin/content and node edit forms with paragraphs)
- screenshots for 1182px vs 1181px