Skip to content

fix: tab/shift-tab does not work as expected in MenuButton #4090

@adamint

Description

@adamint

🐛 Bug Report

The MenuButton component is not accessible to keyboard users. When opening the MenuButton, entering tab should advance to the first element in the menu. Shift-tab should place focus back on the button.

💻 Repro or Code Sample

Can be reproduced in any of the MenuButton examples -> https://www.fluentui-blazor.net/MenuButton

💁 Possible Solution

Register an onkeydown listener on both the first menu item (if one exists) and the menu button. If focus is on the menu button, tab will place focus on the first item in the menu. If focus is on the first menu item, a shift-tab will place focus back on the button.

🔦 Context

Caught in manual testing. I will provide a fix

Metadata

Metadata

Assignees

No one assigned

    Labels

    community:contributionIssue will/can be addressed by community contribution

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions