File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
src/cdk-experimental/dialog Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ export class CdkDialogContainer extends BasePortalOutlet implements OnDestroy {
8282 /** The class that traps and manages focus within the dialog. */
8383 private _focusTrap = this . _focusTrapFactory . create ( this . _elementRef . nativeElement , false ) ;
8484
85- // @HostBinding is used in the class as it is expected to be extended. Since @Component decorator
85+ // @HostBinding is used in the class as it is expected to be extended. Since @Component decorator
8686 // metadata is not inherited by child classes, instead the host binding data is defined in a way
8787 // that can be inherited.
8888 // tslint:disable:no-host-decorator-in-concrete
@@ -93,6 +93,8 @@ export class CdkDialogContainer extends BasePortalOutlet implements OnDestroy {
9393
9494 @HostBinding ( 'attr.role' ) get _role ( ) { return this . _config . role ; }
9595
96+ @HostBinding ( 'attr.aria-modal' ) _ariaModal = true ;
97+
9698 @HostBinding ( 'attr.tabindex' ) get _tabindex ( ) { return - 1 ; }
9799 // tslint:disable:no-host-decorator-in-concrete
98100
Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ describe('Dialog', () => {
7979 viewContainerFixture . detectChanges ( ) ;
8080 let dialogContainerElement = overlayContainerElement . querySelector ( 'cdk-dialog-container' ) ! ;
8181 expect ( dialogContainerElement . getAttribute ( 'role' ) ) . toBe ( 'dialog' ) ;
82+ expect ( dialogContainerElement . getAttribute ( 'aria-modal' ) ) . toBe ( 'true' ) ;
8283 } ) ;
8384
8485 it ( 'should open a dialog with a template' , ( ) => {
@@ -100,6 +101,7 @@ describe('Dialog', () => {
100101
101102 let dialogContainerElement = overlayContainerElement . querySelector ( 'cdk-dialog-container' ) ! ;
102103 expect ( dialogContainerElement . getAttribute ( 'role' ) ) . toBe ( 'dialog' ) ;
104+ expect ( dialogContainerElement . getAttribute ( 'aria-modal' ) ) . toBe ( 'true' ) ;
103105
104106 dialogRef . close ( ) ;
105107 } ) ;
You can’t perform that action at this time.
0 commit comments