Skip to content

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

Merged
ok7sai merged 1 commit into
angular:mainfrom
Daherkarim:kdaher/menubar-active-state-fix
Jun 8, 2026
Merged

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

Conversation

@Daherkarim

@Daherkarim Daherkarim commented May 20, 2026

Copy link
Copy Markdown
Contributor

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
Contributor 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

ok7sai commented Jun 2, 2026

Copy link
Copy Markdown
Member

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
Contributor 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

ok7sai commented Jun 3, 2026

Copy link
Copy Markdown
Member

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

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown

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.

@ok7sai ok7sai added action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels Jun 3, 2026
@ok7sai ok7sai merged commit f5a4195 into angular:main Jun 8, 2026
40 checks passed
@ok7sai

ok7sai commented Jun 8, 2026

Copy link
Copy Markdown
Member

This PR was merged into the repository. The changes were merged into the following branches:

ok7sai pushed a commit that referenced this pull request Jun 8, 2026
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.

(cherry picked from commit f5a4195)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: aria/menu area: docs Related to the documentation dev-app preview When applied, previews of the dev-app are deployed to Firebase target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants