Description
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.
MAT_BUTTON_HOST
disabled attribute
aria-disabled attribute
MAT_ANCHOR_HOST
disabled attribute
components/src/material/button/button-base.ts
Line 218 in bb7563a
aria-disabled attribute
components/src/material/button/button-base.ts
Line 227 in bb7563a
On MAT_ANCHOR_HOST
both get set to _getDisabledAttribute
components/src/material/button/button-base.ts
Lines 204 to 206 in bb7563a
Was expecting thataria-disabled
is set like on MAT_BUTTON_HOST
to _getAriaDisabled
components/src/material/button/button-base.ts
Lines 196 to 202 in bb7563a
Follow up of #29882.
Reproduction
StackBlitz link: https://stackblitz.com/edit/soecj6-6ca7ni?file=src%2Fexample%2Fbutton-overview-example.html
Steps to reproduce:
- Have an anchor button with
disabled
anddisabledInteractive
set totrue
- Notice
aria-disabled
is not applied
Expected Behavior
<a>
button has aria-disabled
applied when disabledInteractive
is true
, like on <button>
Actual Behavior
<a>
button does not have aria-disabled
applied when disabledInteractive
is true
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