Skip to content

docs(aria/menu): fix menubar example highlight styling#33290

Open
Daherkarim wants to merge 1 commit into
angular:mainfrom
Daherkarim:kdaher/menubar-active-state-fix
Open

docs(aria/menu): fix menubar example highlight styling#33290
Daherkarim wants to merge 1 commit into
angular:mainfrom
Daherkarim:kdaher/menubar-active-state-fix

Conversation

@Daherkarim
Copy link
Copy Markdown

@Daherkarim Daherkarim commented May 20, 2026

Summary

Updates the menubar example styles so items highlight only while the user is interacting: :hover, :focus-within, and [aria-expanded='true'] (for when the submenu is open and focus is in the overlay). Items inside an open menu keep their [data-active] highlight.

Test plan

  • Verified in dev-app (pnpm dev-app, Aria Menubar): nothing highlighted at rest, hover/focus highlight the right item, clears on leave.

@pullapprove pullapprove Bot requested review from tjshiu and wagnermaciel May 20, 2026 22:33
@Daherkarim Daherkarim force-pushed the kdaher/menubar-active-state-fix branch from e91435d to a2dc522 Compare May 20, 2026 22:45
@Daherkarim Daherkarim changed the title fix(aria/menubar): prevent stale active state on menubar items fix(aria/menu): prevent stale active state on menubar items May 20, 2026
@Daherkarim
Copy link
Copy Markdown
Author

@crisbeto would you be able to take a look at this when you get a chance?

Thanks!

@Daherkarim Daherkarim force-pushed the kdaher/menubar-active-state-fix branch from a2dc522 to e2bd1e4 Compare June 1, 2026 22:33
@ok7sai
Copy link
Copy Markdown
Member

ok7sai commented Jun 2, 2026

This seems to me the styling issue for code examples on adev. The data-active behavior is expected, the code examples need to be fixed by properly using :focus-within and :hover selectors.

@Daherkarim Daherkarim force-pushed the kdaher/menubar-active-state-fix branch from e2bd1e4 to 7b674e6 Compare June 2, 2026 23:56
Highlight menubar items only while interacting, using :hover, :focus-within, and [aria-expanded='true'] for the open submenu state. Items inside an open menu keep their [data-active] highlight.
@Daherkarim Daherkarim force-pushed the kdaher/menubar-active-state-fix branch from 7b674e6 to f6bab45 Compare June 3, 2026 00:05
@angular-robot angular-robot Bot added the area: docs Related to the documentation label Jun 3, 2026
@Daherkarim Daherkarim changed the title fix(aria/menu): prevent stale active state on menubar items docs(aria/menu): fix menubar example highlight styling Jun 3, 2026
@Daherkarim
Copy link
Copy Markdown
Author

You are right, thanks. data-active is the roving tabindex anchor across all the Aria controls, so it being set at rest is expected. I updated the example CSS so menubar items highlight only on :hover, :focus-within, and [aria-expanded='true'].

@ok7sai ok7sai added the dev-app preview When applied, previews of the dev-app are deployed to Firebase label Jun 3, 2026
@ok7sai
Copy link
Copy Markdown
Member

ok7sai commented Jun 3, 2026

FYI angular/angular#69103 updates the menu examples style on adev. Thanks for raising up the issue!

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

Deployed dev-app for f6bab45 to: https://ng-dev-previews-comp--pr-angular-components-33290-dev-p4l24pi9.web.app

Note: As new commits are pushed to this pull request, this link is updated after the preview is rebuilt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: aria/menu area: docs Related to the documentation dev-app preview When applied, previews of the dev-app are deployed to Firebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants