Skip to content

bug(MatAnchor): disabledInteractive not correctly applied #29882

Closed
@caleniuc

Description

@caleniuc

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

MAT_ANCHOR_HOST applies aria-disabled differently than MAT_BUTTON_HOST. On the anchor, aria-disabled is applied the same as disabled, so disabledInteractive has no effect on it.

Is this intended? I'd expect to be able to navigate via keyboard even on <a> buttons, if disabledInteractive and disabled are set.

Reproduction

StackBlitz link: https://stackblitz.com/edit/soecj6?file=src%2Fexample%2Fbutton-overview-example.html
Steps to reproduce:

  1. Try to navigate via keyboard to the two buttons
  2. Notice that only <button> is reachable, while <a> is not

Expected Behavior

<a> button is reachable via keyboard if disabledInteractive is set and the button is disabled. - aria-disabled is applied on them, like on <button>

Actual Behavior

<a> button is not reachable via keyboard if disabledInteractive is set and the button is disabled.

Environment

  • Angular: v18, v19.0.0-next.2
  • CDK/Material: v18, v19.0.0-next.2
  • Browser(s): Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageThis issue needs to be triaged by the team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions