File tree 4 files changed +13
-1
lines changed 4 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 4
4
align-items : center ;
5
5
padding : 0 24px ;
6
6
border-radius : inherit ;
7
+ position : relative ; // Necessary for the strong focus indication.
7
8
8
9
& :focus ,
9
10
& :hover {
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ import {MatAccordionTogglePosition} from './accordion-base';
48
48
matExpansionAnimations . expansionHeaderHeight
49
49
] ,
50
50
host : {
51
- 'class' : 'mat-expansion-panel-header' ,
51
+ 'class' : 'mat-expansion-panel-header mat-focus-indicator ' ,
52
52
'role' : 'button' ,
53
53
'[attr.id]' : 'panel._headerId' ,
54
54
'[attr.tabindex]' : 'disabled ? -1 : 0' ,
Original file line number Diff line number Diff line change 13
13
transition : margin 225ms $mat-fast-out-slow-in-timing-function ,
14
14
mat-elevation-transition-property-value ();
15
15
16
+ // Required so that the `box-shadow` works after we add `position: relative` to the header.
17
+ position : relative ;
18
+
16
19
.mat-accordion & {
17
20
& :not (.mat-expanded ), & :not (.mat-expansion-panel-spacing ) {
18
21
border-radius : 0 ;
Original file line number Diff line number Diff line change @@ -49,6 +49,14 @@ describe('MatExpansionPanel', () => {
49
49
expect ( headerEl . classList ) . toContain ( 'mat-expanded' ) ;
50
50
} ) ) ;
51
51
52
+ it ( 'should add strong focus indication' , fakeAsync ( ( ) => {
53
+ const fixture = TestBed . createComponent ( PanelWithContent ) ;
54
+ fixture . detectChanges ( ) ;
55
+
56
+ expect ( fixture . nativeElement . querySelector ( '.mat-expansion-panel-header' ) . classList )
57
+ . toContain ( 'mat-focus-indicator' ) ;
58
+ } ) ) ;
59
+
52
60
it ( 'should be able to render panel content lazily' , fakeAsync ( ( ) => {
53
61
const fixture = TestBed . createComponent ( LazyPanelWithContent ) ;
54
62
const content = fixture . debugElement . query (
You can’t perform that action at this time.
0 commit comments