File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -284,6 +284,7 @@ describe('MatTabGroup', () => {
284284 fixture . detectChanges ( ) ;
285285 const labels = fixture . debugElement . queryAll ( By . css ( '.mat-tab-disabled' ) ) ;
286286 expect ( labels . length ) . toBe ( 1 ) ;
287+ expect ( labels [ 0 ] . nativeElement . getAttribute ( 'aria-disabled' ) ) . toBe ( 'true' ) ;
287288 } ) ;
288289
289290 it ( 'should set the disabled flag on tab' , ( ) => {
@@ -293,13 +294,16 @@ describe('MatTabGroup', () => {
293294 let labels = fixture . debugElement . queryAll ( By . css ( '.mat-tab-disabled' ) ) ;
294295 expect ( tabs [ 2 ] . disabled ) . toBe ( false ) ;
295296 expect ( labels . length ) . toBe ( 1 ) ;
297+ expect ( labels [ 0 ] . nativeElement . getAttribute ( 'aria-disabled' ) ) . toBe ( 'true' ) ;
296298
297299 fixture . componentInstance . isDisabled = true ;
298300 fixture . detectChanges ( ) ;
299301
300302 expect ( tabs [ 2 ] . disabled ) . toBe ( true ) ;
301303 labels = fixture . debugElement . queryAll ( By . css ( '.mat-tab-disabled' ) ) ;
302304 expect ( labels . length ) . toBe ( 2 ) ;
305+ expect ( labels . every ( label => label . nativeElement . getAttribute ( 'aria-disabled' ) === 'true' ) )
306+ . toBe ( true ) ;
303307 } ) ;
304308 } ) ;
305309
Original file line number Diff line number Diff line change @@ -198,7 +198,8 @@ export class MatTabHeader extends _MatTabHeaderMixinBase
198198 } ;
199199
200200 this . _keyManager = new FocusKeyManager ( this . _labelWrappers )
201- . withHorizontalOrientation ( this . _getLayoutDirection ( ) ) ;
201+ . withHorizontalOrientation ( this . _getLayoutDirection ( ) )
202+ . withWrap ( ) ;
202203
203204 this . _keyManager . updateActiveItemIndex ( 0 ) ;
204205
Original file line number Diff line number Diff line change @@ -22,7 +22,8 @@ export const _MatTabLabelWrapperMixinBase = mixinDisabled(MatTabLabelWrapperBase
2222 selector : '[matTabLabelWrapper]' ,
2323 inputs : [ 'disabled' ] ,
2424 host : {
25- '[class.mat-tab-disabled]' : 'disabled'
25+ '[class.mat-tab-disabled]' : 'disabled' ,
26+ '[attr.aria-disabled]' : '!!disabled' ,
2627 }
2728} )
2829export class MatTabLabelWrapper extends _MatTabLabelWrapperMixinBase implements CanDisable {
You can’t perform that action at this time.
0 commit comments