Skip to content

Commit 50773aa

Browse files
committed
MOBILE-4065 a11y: Add aria-role region to headings order
1 parent 0b9b617 commit 50773aa

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

src/core/features/block/components/block/block.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
flex-direction: column;
55
background: var(--background);
66

7-
ion-item-divider {
7+
::ng-deep ion-item-divider {
88
min-height: var(--item-divider-min-height);
99
}
1010

src/core/features/block/components/block/block.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export class CoreBlockComponent implements OnChanges, OnDestroy {
3535
@Input() contextLevel!: string; // The context where the block will be used.
3636
@Input() instanceId!: number; // The instance ID associated with the context level.
3737
@Input() extraData!: Record<string, unknown>; // Any extra data to be passed to the block.
38+
@Input() labelledBy?: string;
3839

3940
componentClass?: Type<ICoreBlockComponent>; // The class of the component to render.
4041
data: Record<string, unknown> = {}; // Data to pass to the component.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<!-- Only render the block if it's supported. -->
2-
<ion-card *ngIf="loaded && componentClass && block && block.visible" class="{{class}}">
2+
<ion-card *ngIf="loaded && componentClass && block && block.visible" class="{{class}}" role="region"
3+
[attr.aria-labelledby]="labelledBy ? labelledBy : null">
34
<core-dynamic-component [component]="componentClass" [data]="data"></core-dynamic-component>
45
</ion-card>

src/core/features/courses/pages/my/my.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ <h1>
2222
<core-loading [hideUntil]="loaded">
2323
<ion-item class="ion-text-wrap divider">
2424
<ion-label>
25-
<h2 class="big">{{ 'core.courses.mycourses' | translate }}</h2>
25+
<h2 class="big" id="core-courses-my-title">{{ 'core.courses.mycourses' | translate }}</h2>
2626
</ion-label>
2727
<div slot="end" class="flex-row">
2828
<!-- Download all courses. -->
@@ -46,7 +46,8 @@ <h2 class="big">{{ 'core.courses.mycourses' | translate }}</h2>
4646
</div>
4747
</ion-item>
4848
<ion-list>
49-
<core-block *ngIf="loadedBlock?.visible" [block]="loadedBlock" contextLevel="user" [instanceId]="userId"></core-block>
49+
<core-block *ngIf="loadedBlock?.visible" [block]="loadedBlock" contextLevel="user" [instanceId]="userId"
50+
labelledBy="core-courses-my-title"></core-block>
5051
</ion-list>
5152

5253
<core-block-side-blocks-button slot="fixed" *ngIf="hasSideBlocks" contextLevel="user" [instanceId]="userId"

0 commit comments

Comments
 (0)