Skip to content

Conversation

@chornonoh-vova
Copy link
Contributor

Because the div[role=presentation] is inside the ul and not a list item, it is not allowed (when using TopBar with ActionMenu)
Move it back in and added aria-hidden and hidden to not cause regression with #2148.

@chornonoh-vova chornonoh-vova requested review from a team as code owners January 20, 2026 11:41
Copilot AI review requested due to automatic review settings January 20, 2026 11:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes an HTML accessibility issue where a div[role=presentation] was being incorrectly placed as a direct child of ul[role=menubar] when using TopBar with ActionMenu. The fix moves the menu overlay back inside the trigger element and adds aria-hidden and hidden attributes to prevent regression with issue #2148.

Changes:

  • Updated ActionMenu component to add menuId, aria-controls, aria-hidden, and hidden attributes for better accessibility
  • Modified documentation and examples to render the menu as a child of TopBarItem instead of as a sibling
  • Removed the accessibility note that is no longer applicable with this implementation

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
packages/react/src/components/ActionMenu/ActionMenu.tsx Added menuId generation, aria-controls attribute to trigger, aria-hidden to overlay, and hidden prop to menu list for proper accessibility when using renderInTrigger
docs/pages/components/TopBar.mdx Updated examples to render menu inside TopBarItem and removed outdated accessibility note
docs/index.js Updated example to render menu inside TopBarItem consistent with the new pattern

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@aws-amplify-us-east-1
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-2204.d15792l1n26ww3.amplifyapp.com

@chornonoh-vova chornonoh-vova force-pushed the fix/top-bar-with-action-menu-aria-required-children branch from a2f8739 to f1f99ca Compare January 20, 2026 12:09
After expanding the submenu, remove bottom border of "Menu" menu item.

Also on shift+tab from submenu items, that is when the user lands on "Menu" menu
item, made sure the border reappears and sub menu is collapsed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants