Skip to content

Conversation

hxrshxz
Copy link

@hxrshxz hxrshxz commented Oct 6, 2025

Description

When keyboard users navigated to the menu button and pressed Tab to move focus away, the menu list would automatically expand but was not fully visible on mobile viewports. This occurred because the menu links were still in the tab order even when the menu was closed, causing focus to move inside the hidden menu panel.

Fixes #915

Solution

Added dynamic tabIndex to navigation links:

  • When menu is open: tabIndex={0} (links are focusable)
  • When menu is closed: tabIndex={-1} (links are removed from tab order)

Menu list no longer automatically expands when keyboard users tab away from the menu button.

This makke sures that tabbing away from the menu button moves focus to the next element outside the menu, not to hidden links inside it.

@Copilot Copilot AI review requested due to automatic review settings October 6, 2025 11:31
Copy link

@Copilot 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

Fixes keyboard navigation accessibility issue where hidden menu links remained focusable when the menu was closed, causing unwanted menu expansion on mobile viewports.

  • Adds dynamic tabIndex attribute to all navigation links based on menu state
  • Prevents focus from moving to hidden menu links when tabbing away from menu button
  • Ensures proper tab order flow for keyboard users

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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.

[Menu] Menu list automatically expands on Tab key navigation but is not visible

1 participant