File tree Expand file tree Collapse file tree 4 files changed +13
-1
lines changed Expand file tree Collapse file tree 4 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 44 align-items : center ;
55 padding : 0 24px ;
66 border-radius : inherit ;
7+ position : relative ; // Necessary for the strong focus indication.
78
89 & :focus ,
910 & :hover {
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ import {MatAccordionTogglePosition} from './accordion-base';
4848 matExpansionAnimations . expansionHeaderHeight
4949 ] ,
5050 host : {
51- 'class' : 'mat-expansion-panel-header' ,
51+ 'class' : 'mat-expansion-panel-header mat-focus-indicator ' ,
5252 'role' : 'button' ,
5353 '[attr.id]' : 'panel._headerId' ,
5454 '[attr.tabindex]' : 'disabled ? -1 : 0' ,
Original file line number Diff line number Diff line change 1313 transition : margin 225ms $mat-fast-out-slow-in-timing-function ,
1414 mat-elevation-transition-property-value ();
1515
16+ // Required so that the `box-shadow` works after we add `position: relative` to the header.
17+ position : relative ;
18+
1619 .mat-accordion & {
1720 & :not (.mat-expanded ), & :not (.mat-expansion-panel-spacing ) {
1821 border-radius : 0 ;
Original file line number Diff line number Diff line change @@ -49,6 +49,14 @@ describe('MatExpansionPanel', () => {
4949 expect ( headerEl . classList ) . toContain ( 'mat-expanded' ) ;
5050 } ) ) ;
5151
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+
5260 it ( 'should be able to render panel content lazily' , fakeAsync ( ( ) => {
5361 const fixture = TestBed . createComponent ( LazyPanelWithContent ) ;
5462 const content = fixture . debugElement . query (
You can’t perform that action at this time.
0 commit comments