Skip to content

core(menu): Implement w3c menu pattern for ix-menu#2573

Draft
lzeiml wants to merge 2 commits into
mainfrom
feat/4304-menu-a11y
Draft

core(menu): Implement w3c menu pattern for ix-menu#2573
lzeiml wants to merge 2 commits into
mainfrom
feat/4304-menu-a11y

Conversation

@lzeiml
Copy link
Copy Markdown
Collaborator

@lzeiml lzeiml commented May 28, 2026

💡 What is the current behavior?

GitHub Issue Number: #

🆕 What is the new behavior?

🏁 Checklist

A pull request can only be merged if all of these conditions are met (where applicable):

  • 🦮 Accessibility (a11y) features were implemented
  • 🗺️ Internationalization (i18n) - no hard coded strings
  • 📲 Responsiveness - components handle viewport changes and content overflow gracefully
  • 📕 Add or update a Storybook story
  • 📄 Documentation was reviewed/updated siemens/ix-docs
  • 🧪 Unit tests were added/updated and pass (pnpm test)
  • 📸 Visual regression tests were added/updated and pass (Guide)
  • 🧐 Static code analysis passes (pnpm lint)
  • 🏗️ Successful compilation (pnpm build, changes pushed)

👨‍💻 Help & support

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 28, 2026

⚠️ No Changeset found

Latest commit: 41557c5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link
Copy Markdown

netlify Bot commented May 28, 2026

Deploy Preview for ix-storybook ready!

Name Link
🔨 Latest commit 41557c5
🔍 Latest deploy log https://app.netlify.com/projects/ix-storybook/deploys/6a184f569b27000008fba149
😎 Deploy Preview https://deploy-preview-2573--ix-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces keyboard navigation and a roving tab index mechanism for the ix-menu component, updating ix-menu-item and ix-menu-category to support dynamic tab index configuration. A critical review comment points out that using closest('ix-menu') to identify direct menu children is too broad and will break focusability for nested items in slots like ix-menu-settings, suggesting a direct parent check instead.

Comment on lines +146 to +147
const isDirectMenuChild =
!this.isHostedInsideCategory && !!this.hostElement.closest('ix-menu');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

Using closest('ix-menu') to determine if the item is a direct menu child is too broad. If an ix-menu-item is placed inside nested slots of ix-menu (such as ix-menu-settings or ix-menu-about), closest('ix-menu') will still return true. However, these nested items are not direct children and are not queried by getAllFocusableItems(), meaning their tab index will never be updated and they will remain permanently unfocusable (tabIndex = -1).

To fix this, check if the parent element is directly ix-menu instead of using closest.

Suggested change
const isDirectMenuChild =
!this.isHostedInsideCategory && !!this.hostElement.closest('ix-menu');
const isDirectMenuChild =
!this.isHostedInsideCategory &&
this.hostElement.parentElement?.tagName?.toLowerCase() === 'ix-menu';

@sonarqubecloud
Copy link
Copy Markdown

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.

1 participant