File tree Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -48,17 +48,11 @@ describe('tabs', () => {
48
48
pressKeys ( right ) ;
49
49
expect ( await getFocusStates ( tabLabels ) ) . toEqual ( [ false , false , true ] ) ;
50
50
51
- pressKeys ( right ) ;
52
- expect ( await getFocusStates ( tabLabels ) ) . toEqual ( [ false , false , true ] ) ;
53
-
54
51
pressKeys ( left ) ;
55
52
expect ( await getFocusStates ( tabLabels ) ) . toEqual ( [ false , true , false ] ) ;
56
53
57
54
pressKeys ( left ) ;
58
55
expect ( await getFocusStates ( tabLabels ) ) . toEqual ( [ true , false , false ] ) ;
59
-
60
- pressKeys ( left ) ;
61
- expect ( await getFocusStates ( tabLabels ) ) . toEqual ( [ true , false , false ] ) ;
62
56
} ) ;
63
57
} ) ;
64
58
} ) ;
Original file line number Diff line number Diff line change @@ -284,6 +284,7 @@ describe('MatTabGroup', () => {
284
284
fixture . detectChanges ( ) ;
285
285
const labels = fixture . debugElement . queryAll ( By . css ( '.mat-tab-disabled' ) ) ;
286
286
expect ( labels . length ) . toBe ( 1 ) ;
287
+ expect ( labels [ 0 ] . nativeElement . getAttribute ( 'aria-disabled' ) ) . toBe ( 'true' ) ;
287
288
} ) ;
288
289
289
290
it ( 'should set the disabled flag on tab' , ( ) => {
@@ -293,13 +294,16 @@ describe('MatTabGroup', () => {
293
294
let labels = fixture . debugElement . queryAll ( By . css ( '.mat-tab-disabled' ) ) ;
294
295
expect ( tabs [ 2 ] . disabled ) . toBe ( false ) ;
295
296
expect ( labels . length ) . toBe ( 1 ) ;
297
+ expect ( labels [ 0 ] . nativeElement . getAttribute ( 'aria-disabled' ) ) . toBe ( 'true' ) ;
296
298
297
299
fixture . componentInstance . isDisabled = true ;
298
300
fixture . detectChanges ( ) ;
299
301
300
302
expect ( tabs [ 2 ] . disabled ) . toBe ( true ) ;
301
303
labels = fixture . debugElement . queryAll ( By . css ( '.mat-tab-disabled' ) ) ;
302
304
expect ( labels . length ) . toBe ( 2 ) ;
305
+ expect ( labels . every ( label => label . nativeElement . getAttribute ( 'aria-disabled' ) === 'true' ) )
306
+ . toBe ( true ) ;
303
307
} ) ;
304
308
} ) ;
305
309
Original file line number Diff line number Diff line change @@ -198,7 +198,8 @@ export class MatTabHeader extends _MatTabHeaderMixinBase
198
198
} ;
199
199
200
200
this . _keyManager = new FocusKeyManager ( this . _labelWrappers )
201
- . withHorizontalOrientation ( this . _getLayoutDirection ( ) ) ;
201
+ . withHorizontalOrientation ( this . _getLayoutDirection ( ) )
202
+ . withWrap ( ) ;
202
203
203
204
this . _keyManager . updateActiveItemIndex ( 0 ) ;
204
205
Original file line number Diff line number Diff line change @@ -22,7 +22,8 @@ export const _MatTabLabelWrapperMixinBase = mixinDisabled(MatTabLabelWrapperBase
22
22
selector : '[matTabLabelWrapper]' ,
23
23
inputs : [ 'disabled' ] ,
24
24
host : {
25
- '[class.mat-tab-disabled]' : 'disabled'
25
+ '[class.mat-tab-disabled]' : 'disabled' ,
26
+ '[attr.aria-disabled]' : '!!disabled' ,
26
27
}
27
28
} )
28
29
export class MatTabLabelWrapper extends _MatTabLabelWrapperMixinBase implements CanDisable {
You can’t perform that action at this time.
0 commit comments