File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ export class MatListSubheaderCssMatStyler {}
119
119
selector : 'mat-list-item, a[mat-list-item]' ,
120
120
exportAs : 'matListItem' ,
121
121
host : {
122
- 'role' : 'listitem ' ,
122
+ '[attr. role] ' : 'role ' ,
123
123
'class' : 'mat-list-item' ,
124
124
'(focus)' : '_handleFocus()' ,
125
125
'(blur)' : '_handleBlur()' ,
@@ -134,6 +134,7 @@ export class MatListItem extends _MatListItemMixinBase implements AfterContentIn
134
134
CanDisableRipple {
135
135
private _lineSetter : MatLineSetter ;
136
136
private _isNavList : boolean = false ;
137
+ role : string | null = null ;
137
138
138
139
@ContentChildren ( MatLine ) _lines : QueryList < MatLine > ;
139
140
@@ -150,6 +151,7 @@ export class MatListItem extends _MatListItemMixinBase implements AfterContentIn
150
151
@Optional ( ) private _navList : MatNavList ) {
151
152
super ( ) ;
152
153
this . _isNavList = ! ! _navList ;
154
+ this . role = this . _isNavList ? null : 'listitem' ;
153
155
}
154
156
155
157
ngAfterContentInit ( ) {
You can’t perform that action at this time.
0 commit comments