Skip to content

bug(button): Icon Button Focusing Inconsistent #28600

Open
@karmasakshi

Description

@karmasakshi

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

No response

Description

This bug can be seen on the documentation page of Menu component. If you go to https://material.angular.io/components/menu/examples and scroll down to "Menu with icons" section, the icon button will sometimes be left focused after opening and closing the menu. See below:

Screen.Recording.2024-02-17.at.1.09.55.AM.mov

One thing to note, I'm seeing this issue only with trackpad taps, not with trackpad clicks. See below:

Screen.Recording.2024-02-17.at.1.11.22.AM.mov

Reproduction

StackBlitz link: https://stackblitz.com/edit/stackblitz-starters-fntbkn?file=src%2Fmain.ts

Screen Shot 2024-02-17 at 1 25 55 AM

Steps to reproduce:

  1. Click on the icon button to open the menu
  2. Click again on the icon button to close the menu
  3. Move the cursor away from the button
  4. Repeat

Expected Behavior

The focus on the icon button should be gone on hovering away from the button.

Actual Behavior

The focus stays on the button.

Environment

  • Angular: 17.2.1
  • CDK/Material: 17.2.0
  • Browser(s): Chrome, Firefox and Safari latest
  • Operating System (e.g. Windows, macOS, Ubuntu): macOS 12.7.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    AccessibilityThis issue is related to accessibility (a11y)P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: cdk/overlayarea: material/buttonarea: material/menu

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions