Make WordPress Core

Opened 5 months ago

Closed 4 months ago

Last modified 4 months ago

#61672 closed defect (bug) (fixed)

Twenty Twelve: navigation block submenus are cut off

Reported by: poena's profile poena Owned by: karmatosed's profile karmatosed
Milestone: 6.7 Priority: normal
Severity: normal Version:
Component: Bundled Theme Keywords: has-patch needs-testing commit
Focuses: css Cc:

Description (last modified by poena)

When adding a navigation block that has a submenu to a post or page, the submenus are visibly cut off on the front of the site.
I am only able to see and select part of the first level of submenus, the rest are hidden.

The navigation block is affected both by theme styles for the
div element https://core.trac.wordpress.org/browser/branches/6.6/src/wp-content/themes/twentytwelve/style.css#L58

and .site-content nav https://core.trac.wordpress.org/browser/branches/6.6/src/wp-content/themes/twentytwelve/style.css#L421

.site-content nav {
    clear: both;
    line-height: 2;
   overflow: hidden;
}

If I remove the overflow:hidden, the navigation block works.

Attachments (4)

navigation-block-66.png (14.1 KB) - added by poena 5 months ago.
The navigation block with submenus cut off.
61672.clearfix.diff (536 bytes) - added by sabernhardt 5 months ago.
Option 1: add an :after pseudo-element to clear the floats instead of overflow: hidden
61672.blocks.css.diff (554 bytes) - added by sabernhardt 5 months ago.
Option 2: show the overflow on Navigation blocks only, within the .site-content area
2012-comments-nav-focus-cutoff.png (2.2 KB) - added by sabernhardt 4 months ago.
previous comments link with focus outline cut off

Download all attachments as: .zip

Change History (12)

@poena
5 months ago

The navigation block with submenus cut off.

#1 @poena
5 months ago

  • Description modified (diff)

#2 @sabernhardt
5 months ago

  • Focuses css added
  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to Future Release

Twenty Twelve uses overflow: hidden to clear floats in (at least) the post and comment pagination link nav elements (committed on GitHub between [20219] and [21261]).

While hiding the overflow clips one side of the focus outline for previous and next links, I'm reluctant to replace the floating or to add an ::after clearfix in a 12-year-old theme.

To adjust for only the Navigation block, the theme's blocks.css could include

nav.wp-block-navigation {
	overflow: visible;
}

@sabernhardt
5 months ago

Option 1: add an :after pseudo-element to clear the floats instead of overflow: hidden

@sabernhardt
5 months ago

Option 2: show the overflow on Navigation blocks only, within the .site-content area

#3 @sabernhardt
5 months ago

  • Keywords has-patch added; needs-patch removed

61672.clearfix.diff

  • Removes overflow: hidden from any nav elements in the .site-content area.
  • Adds an :after pseudo-element (but not :before) to clear the floats for post and comment pagination.
  • Sets the width to 1px in case someone added display: flex to either navigation.

61672.blocks.css.diff (simpler option)

  • Keeps overflow: hidden for nav elements in the .site-content area.
  • Overrides overflow: hidden for the Navigation block only.
  • Uses .site-content .wp-block-navigation as the selector to reflect the scope of .site-content nav.

#4 @karmatosed
4 months ago

  • Keywords needs-testing added
  • Owner set to karmatosed
  • Status changed from new to assigned

Thanks everyone. I am going to add testing keywords and see about progressing this forward.

#5 @karmatosed
4 months ago

My vote is for the simpler version @sabernhardt and I will happily commit it, but wanted to check if you agreed on that. I have tested it.

#6 @sabernhardt
4 months ago

  • Milestone changed from Future Release to 6.7

Yes, 61672.blocks.css.diff should be safer.

The clearfix method was worth trying because one side of the focus outline for post and comment navigation links can be cut off, but it has been that way for a long time (and there might be a simpler way of adjusting those by one pixel if we want to pursue that).

@sabernhardt
4 months ago

previous comments link with focus outline cut off

#7 @karmatosed
4 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 58887:

Twenty Twelve: Fixes navigation block submenus being cut off.

The navigation block submenus were being cut off. This is the simpler method proposed in patches.

Props poena, sabernhardt.
Fixes #61672.

#8 @karmatosed
4 months ago

  • Keywords commit added
Note: See TracTickets for help on using tickets.