Skip to content

Commit ec7311a

Browse files
fix(components/errors): set ariaLabelledBy for error modals to satisfy accessibility rules (#819)
1 parent e5e3ac7 commit ec7311a

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

libs/components/errors/src/lib/modules/error/error-modal-form.component.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
<sky-modal>
1+
<sky-modal [ariaLabelledBy]="title.id">
22
<sky-modal-content>
33
<div class="sky-error-modal-container">
4-
<span class="sky-error-modal-title">{{ context.errorTitle }}</span>
4+
<span class="sky-error-modal-title" skyId #title="skyId">{{
5+
context.errorTitle
6+
}}</span>
57
<span class="sky-error-modal-description">{{
68
context.errorDescription
79
}}</span>

libs/components/errors/src/lib/modules/error/error.module.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { CommonModule } from '@angular/common';
22
import { NgModule } from '@angular/core';
3+
import { SkyIdModule } from '@skyux/core';
34
import { SkyModalModule } from '@skyux/modals';
45

56
import { SkyErrorsResourcesModule } from '../shared/sky-errors-resources.module';
@@ -20,7 +21,12 @@ import { SkyErrorComponent } from './error.component';
2021
SkyErrorActionComponent,
2122
SkyErrorModalFormComponent,
2223
],
23-
imports: [CommonModule, SkyErrorsResourcesModule, SkyModalModule],
24+
imports: [
25+
CommonModule,
26+
SkyErrorsResourcesModule,
27+
SkyIdModule,
28+
SkyModalModule,
29+
],
2430
exports: [
2531
SkyErrorComponent,
2632
SkyErrorImageComponent,

libs/components/modals/src/lib/modules/modal/modal.component.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ export class SkyModalComponent implements AfterViewInit, OnDestroy {
6767

6868
public ariaDescribedBy: string;
6969

70+
/**
71+
* @internal
72+
*/
73+
@Input()
7074
public ariaLabelledBy: string;
7175

7276
public helpKey: string | undefined;

0 commit comments

Comments
 (0)