Problem/Motivation

To address the issue within the Olivero theme where the focus outline of the first and last items in the second-level navigation is cut off due to a overflow-auto. when accessing the menu via the tab key in mobile mode

It is important to ensure that the entire focus outline remains fully visible.

Steps to reproduce

  • setup the Drupal 11.x and enable the olivero theme
  • on path 'admin/structure/menu/manage/main', create a menu with submenus
  • turn on mobile mode, access the sub menu through the tab key

Proposed resolution

To address the issue, apply vertical spacing at the top and bottom of the menu.

Remaining tasks

Review

User interface changes

Before

before

After

after

API changes

NA

Data model changes

NA

Release notes snippet

NA

Issue fork drupal-3191727

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

mherchel created an issue. See original summary.

djsagar’s picture

Status: Active » Postponed (maintainer needs more info)
djsagar’s picture

Status: Postponed (maintainer needs more info) » Active
poojakural’s picture

Assigned: Unassigned » poojakural
poojakural’s picture

@mherchel not able to replicate the issue. Could you please provide SS.

poojakural’s picture

Assigned: poojakural » Unassigned
gauravvvv’s picture

I have attached a patch and after patch screenshot for reference. Please review.

gauravvvv’s picture

Status: Active » Needs review
imalabya’s picture

StatusFileSize
new1.02 KB

The default value for overflow property is visible, so we don't have to add it unless we are trying to override the value. Removing the whole property in the patch.

imalabya’s picture

StatusFileSize
new1.02 KB

Re-uploading the patch

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.

gauravvvv’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new27.15 KB

Patch #10, works fine. moving to RTBC.

Attached after patch screenshot for reference

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 10: 3191727-10.patch, failed testing. View results

gauravvvv’s picture

Status: Needs work » Reviewed & tested by the community

Unrelated failure, moving back to RTBC

mherchel’s picture

Status: Reviewed & tested by the community » Needs work

Thanks for the patch.

The overflow property was put in place to ensure that the menu items do not overlap other menu items as the CSS transition is being performed. This patch breaks that. We need to figure out another way to do this.

gauravvvv’s picture

Status: Needs work » Needs review
chetanbharambe’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new216.67 KB
new217.43 KB
new316.72 KB
new218.4 KB

Verified and tested merge request !1073 - https://git.drupalcode.org/project/drupal/-/merge_requests/1073.patch
Patch applied successfully and looks good to me.

Testing Steps:
# Goto: Appearance -> Apply Olivero theme
# Goto: admin/structure/menu/manage/main?destination=/en/admin/structure/menu
# Add the submenus under any main navigation menu
# Goto Responsiveness devices
# Perform the accessibility and observe the below mentioned results.

Expected Results:
# After applying merge request !1073, Focus states on mobile second-level navigation items should not be cut off. Users should see a proper focus on the respective navigations.

Actual Results:
# Focus states on mobile second-level navigation items can get cut off.

Please refer attached screenshots for the same.
Looks good to me.
Can be a move to RTBC.

lauriii’s picture

Status: Reviewed & tested by the community » Needs work
Related issues: +#3200584: Olivero's focus state outline can get cut off certain situations

The patch adds a lot of more spacing to links in the mobile menu. This can be seen in the screenshots posted in #18. I don't think that's desired, so moving back to needs work.

vikashsoni’s picture

StatusFileSize
new25.24 KB
new26.19 KB

Applied patch #7 working fine
Thnaks for the patch
For ref sharing screenshots....

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.

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

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

mgifford’s picture

santosh_verma’s picture

StatusFileSize
new1.04 KB
new1.36 KB

I am addressing the comment #19 in this patch, I have made the necessary adjustment to the padding by changing it from var(--sp0-5) to var(--sp0-25), which is the smallest value available. This change successfully resolved the issue related to the “Focus states on mobile second level.” attaching the patch and inderdiff.

I attempted to create a merge request but encountered an error on my local machine. As a workaround, I am creating a patch file in the hopes that this solution will be helpful.

santosh_verma’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative, +Needs screenshots, +Needs issue summary update

Issue summary should be updated with proposed solution.

Also as UI change before/after screenshots should be added.

Harish1688’s picture

Issue summary: View changes
Harish1688’s picture

1. Update the issue summary with proposed solution,
2. I have tested patch #26 and it is working fine. As requested in #28, I am attaching a screenshot for reference.

Before
Only local images are allowed.
After
Only local images are allowed.

RTBC +1

Harish1688’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Needs work

Still missing screenshots.

Harish1688’s picture

Status: Needs work » Needs review
StatusFileSize
new21.22 KB
new28.59 KB

strange, I have checked the images on others system, it's visible on some and breaks on some.
so updated the images again.

Images:
3191727 after patch 26.png
3191727 before patch 26.png

smustgrave’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs screenshots, -Needs issue summary update

Issue appears to have been resolved. Updated issue summary.

gauravvvv’s picture

Updated attributions

mherchel’s picture

Status: Reviewed & tested by the community » Needs work

This patch works by adding a bit of vertical padding to the mobile second-level menu, which makes room for the focus outline. This slightly changes the design, but I think this is okay (no one's going to notice).

Code-wise, it's creating a duplicate selector, though. The rule should be placed within the existing .primary-nav__menu--level-2 block around line 153 of nav-primary.pcss.css.

Other than that its a straightforward fix.

mherchel’s picture

santosh_verma’s picture

working on it

santosh_verma’s picture

StatusFileSize
new1.12 KB
new1.46 KB

Addressing the comment #36, and created a patch along with interdiff. No additional screenshots are being added as they are the same as the ones uploaded in comment #33.

mherchel’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Refactor looks good.

lauriii’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new52.03 KB

It looks like the padding breaks the close animation. There's a blue border visible during the animation:

santosh_verma’s picture

working on it

santosh_verma’s picture

StatusFileSize
new2.79 MB
new1.35 KB
new1.77 KB

In this patch, I have addressed the comment #42 by adjusting the styling. The issue was that the padding on the ul(primary-nav__menu--level-2) element was causing the animation to break. To fix this, I have removed the padding from the ul(primary-nav__menu--level-2) and instead added padding to the first and last child of the second level items (primary-nav__menu-item--level-2). This solution addresses both the problem of focus cut off and the animation breaking.

after

santosh_verma’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Can confirm I'm also seeing the results from #44 applying the patch.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 44: 3191727-44.patch, failed testing. View results

chetansonawane’s picture

Assigned: Unassigned » chetansonawane
chetansonawane’s picture

Assigned: chetansonawane » Unassigned
StatusFileSize
new3.24 MB

I checked the same patch #44 it is working fine with php 8.3, Drupal 11 requires PHP 8.3.
menu tab

chetansonawane’s picture

Status: Needs work » Reviewed & tested by the community
nod_’s picture

Status: Reviewed & tested by the community » Needs work

RTBC looks fine, Can I get the changes in a MR please? Thanks!

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

ahsannazir’s picture

Status: Needs work » Needs review
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Copy to MR seems fine.

  • nod_ committed 57e4625a on 10.3.x
    Issue #3191727 by Santosh_Verma, Gauravvvv, imalabya, chetanbharambe,...

  • nod_ committed 4c8f3371 on 10.4.x
    Issue #3191727 by Santosh_Verma, Gauravvvv, imalabya, chetanbharambe,...

  • nod_ committed 1e0296d3 on 11.0.x
    Issue #3191727 by Santosh_Verma, Gauravvvv, imalabya, chetanbharambe,...

  • nod_ committed 924d567a on 11.x
    Issue #3191727 by Santosh_Verma, Gauravvvv, imalabya, chetanbharambe,...
nod_’s picture

Version: 11.x-dev » 10.3.x-dev
Status: Reviewed & tested by the community » Fixed

Committed and pushed 924d567aac to 11.x and 1e0296d353 to 11.0.x and 4c8f3371e4 to 10.4.x and 57e4625a18 to 10.3.x. Thanks!

Status: Fixed » Closed (fixed)

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