Skip to content

Commit fa7cd15

Browse files
zarendmmalerba
authored andcommittedJan 21, 2022
fix(material/list): fix duplicate focus with chromevox on action-list items (#23361)
For the mat-action-list component, fix chromevox screenreader bug where it duplicated focus on each item in the action list. After focusing on a `button` in the action list, linearly navigating forward moved focus to the `.mat-list-item-content` of the same item. Fixes this by change the list item content from a `div` to `span`, since we're generally not supposed to use div's inside buttons. (cherry picked from commit 8182b35)
1 parent 68a29ff commit fa7cd15

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed
 

‎src/material/list/list-item.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
<div class="mat-list-item-content">
2-
<div class="mat-list-item-ripple" mat-ripple
1+
<span class="mat-list-item-content">
2+
<span class="mat-list-item-ripple" mat-ripple
33
[matRippleTrigger]="_getHostElement()"
44
[matRippleDisabled]="_isRippleDisabled()">
5-
</div>
5+
</span>
66

77
<ng-content select="[mat-list-avatar], [mat-list-icon], [matListAvatar], [matListIcon]">
88
</ng-content>
99

10-
<div class="mat-list-text"><ng-content select="[mat-line], [matLine]"></ng-content></div>
10+
<span class="mat-list-text"><ng-content select="[mat-line], [matLine]"></ng-content></span>
1111

1212
<ng-content></ng-content>
13-
</div>
13+
</span>

‎src/material/list/list.scss

+1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ $item-inset-divider-offset: 72px;
6666
}
6767

6868
.mat-list-item-ripple {
69+
display: block;
6970
@include layout-common.fill;
7071

7172
// Disable pointer events for the ripple container because the container will overlay the

0 commit comments

Comments
 (0)
Please sign in to comment.