bug(mat-button-toggle): Disabled buttons are not ignored in radio pattern interaction for single select #29304
Labels
Accessibility
This issue is related to accessibility (a11y)
area: material/button-toggle
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Is this a regression?
The previous version in which this bug was not present was
No response
Description
After the implementation of the keyboard interaction in v18 (#28548) we spotted a small issue with the behavior when there are disabled buttons in the
mat-button-toggle-group
. While navigating the selection in the group via keyboard, the selection can move into the disabled buttons and then stops, preventing the navigation to the rest of the items after the disabled button. Also, visually it looks like both disabled and the previous button are highlighted.Reproduction
StackBlitz link: https://stackblitz.com/edit/ywl3wm-hddgcz?file=src%2Fexample%2Fbutton-toggle-overview-example.html
Steps to reproduce:
Extra notes:
While the selection is on the disabled item, if you hit Space or Enter the selection will move back to the previous active item.
Expected Behavior
By using the arrow keys, the selection should rotate around the active buttons and ignore the disabled ones.
Actual Behavior
The selection allows selecting a disabled button, and once selected, it cannot move the selection further. When attempting to move back, the selection jumps over one item.
Environment
The text was updated successfully, but these errors were encountered: