Skip to content

Menu: should not return focus to trigger an active element outside of the menu already exists #27373

Description

@ling1726

Environment Information

  • Package version(s): (fill this out)
  • Browser and OS versions: (fill this out if relevant)

Describe the issue:

If a user focuses on an element that is not in the menu or the menu trigger, closing the menu should not steal focus back to the trigger

Actual behavior:

When the menu closes focus always reverts to the menu trigger

Expected behavior:

If an element outside the menu or the menu trigger is focused, should not revert focus

If applicable, please provide a codepen repro:

https://codesandbox.io/s/determined-maria-1r0ibr?file=/example.tsx

Priorities and help requested (not applicable if asking question):

Are you willing to submit a PR to fix? Yes

Requested priority: (Blocking, High, Normal, Low)

Products/sites affected: Teams

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions