Skip to content

Commit 8996cef

Browse files
committed
MOBILE-4069 a11y: Remove unneeded aria-labelledby
With the latest Ionic update, these aria-labelledby aren't needed and one of them even caused a behat test to fail
1 parent 138377e commit 8996cef

File tree

8 files changed

+22
-39
lines changed

8 files changed

+22
-39
lines changed

src/addons/mod/forum/pages/new-discussion/new-discussion.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ <h2>{{ 'addon.mod_forum.advanced' | translate }}</h2>
4646
<ion-toggle [(ngModel)]="newDiscussion.postToAllGroups" name="postallgroups"></ion-toggle>
4747
</ion-item>
4848
<ion-item *ngIf="showGroups" class="core-edit-set-group">
49-
<ion-label id="addon-mod-forum-groupslabel">{{ 'addon.mod_forum.group' | translate }}</ion-label>
50-
<ion-select [(ngModel)]="newDiscussion.groupId" [disabled]="newDiscussion.postToAllGroups"
51-
aria-labelledby="addon-mod-forum-groupslabel" interface="action-sheet" name="groupid"
52-
[interfaceOptions]="{header: 'addon.mod_forum.group' | translate}" (ionChange)="calculateGroupName()">
49+
<ion-label>{{ 'addon.mod_forum.group' | translate }}</ion-label>
50+
<ion-select [(ngModel)]="newDiscussion.groupId" [disabled]="newDiscussion.postToAllGroups" interface="action-sheet"
51+
name="groupid" [interfaceOptions]="{header: 'addon.mod_forum.group' | translate}"
52+
(ionChange)="calculateGroupName()">
5353
<ion-select-option *ngFor="let group of groups" [value]="group.id">{{ group.name }}</ion-select-option>
5454
</ion-select>
5555
</ion-item>

src/addons/mod/glossary/pages/edit/edit.html

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,22 @@ <h1 *ngIf="glossary">
2828
</core-rich-text-editor>
2929
</ion-item>
3030
<ion-item *ngIf="categories.length > 0">
31-
<ion-label position="stacked" id="addon-mod-glossary-categories-label">
31+
<ion-label position="stacked">
3232
{{ 'addon.mod_glossary.categories' | translate }}
3333
</ion-label>
34-
<ion-select [(ngModel)]="options.categories" multiple="true" aria-labelledby="addon-mod-glossary-categories-label"
35-
interface="action-sheet" [placeholder]="'addon.mod_glossary.categories' | translate" name="categories"
34+
<ion-select [(ngModel)]="options.categories" multiple="true" interface="action-sheet"
35+
[placeholder]="'addon.mod_glossary.categories' | translate" name="categories"
3636
[interfaceOptions]="{header: 'addon.mod_glossary.categories' | translate}">
3737
<ion-select-option *ngFor="let category of categories" [value]="category.id">
3838
{{ category.name }}
3939
</ion-select-option>
4040
</ion-select>
4141
</ion-item>
4242
<ion-item>
43-
<ion-label position="stacked" id="addon-mod-glossary-aliases-label">
43+
<ion-label position="stacked">
4444
{{ 'addon.mod_glossary.aliases' | translate }}
4545
</ion-label>
46-
<ion-textarea [(ngModel)]="options.aliases" rows="1" [core-auto-rows]="options.aliases"
47-
aria-labelledby="addon-mod-glossary-aliases-label" name="aliases">
46+
<ion-textarea [(ngModel)]="options.aliases" rows="1" [core-auto-rows]="options.aliases" name="aliases">
4847
</ion-textarea>
4948
</ion-item>
5049
<ion-item-divider>

src/addons/mod/lesson/pages/player/player.html

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,12 @@ <h3 class="item-heading">{{ 'addon.mod_lesson.youranswer' | translate }}</h3>
138138
<ion-item class="ion-text-wrap" *ngFor="let row of question.rows">
139139
<ion-label>
140140
<p>
141-
<core-format-text id="addon-mod_lesson-matching-{{row.id}}" [component]="component"
142-
[componentId]="lesson?.coursemodule" [text]="row.text" contextLevel="module"
143-
[contextInstanceId]="lesson?.coursemodule" [courseId]="courseId">
141+
<core-format-text [component]="component" [componentId]="lesson?.coursemodule" [text]="row.text"
142+
contextLevel="module" [contextInstanceId]="lesson?.coursemodule" [courseId]="courseId">
144143
</core-format-text>
145144
</p>
146145
</ion-label>
147-
<ion-select [id]="row.id" [formControlName]="row.name" interface="action-sheet"
148-
[attr.aria-labelledby]="'addon-mod_lesson-matching-' + row.id">
146+
<ion-select [id]="row.id" [formControlName]="row.name" interface="action-sheet">
149147
<ion-select-option *ngFor="let option of row.options" [value]="option.value">
150148
{{option.label}}
151149
</ion-select-option>

src/addons/mod/lesson/pages/user-retake/user-retake.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@ <h2>{{student.fullname}}</h2>
2727

2828
<!-- Retake selector if there is more than one retake. -->
2929
<ion-item class="ion-text-wrap" *ngIf="student.attempts && student.attempts.length > 1">
30-
<ion-label id="addon-mod_lesson-retakeslabel">{{ 'addon.mod_lesson.attemptheader' | translate }}</ion-label>
31-
<ion-select [(ngModel)]="selectedRetake" (ionChange)="changeRetake(selectedRetake!)"
32-
aria-labelledby="addon-mod_lesson-retakeslabel" interface="action-sheet"
30+
<ion-label>{{ 'addon.mod_lesson.attemptheader' | translate }}</ion-label>
31+
<ion-select [(ngModel)]="selectedRetake" (ionChange)="changeRetake(selectedRetake!)" interface="action-sheet"
3332
[interfaceOptions]="{header: 'addon.mod_lesson.attemptheader' | translate}">
3433
<ion-select-option *ngFor="let retake of student.attempts" [value]="retake.try">
3534
{{retake.label}}

src/addons/mod/survey/components/index/addon-mod-survey-index.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,12 @@ <h3 class="ion-padding-horizontal" [class.ion-padding-top]="questionIndex == 1">
102102
</ion-row>
103103

104104
<ion-item *ngIf="question.type === 0" class="ion-text-wrap" [class.even]="isEven">
105-
<ion-label position="floating" id="addon-mod_survey-{{question.name}}">
105+
<ion-label position="floating">
106106
<span [core-mark-required]="question.required">
107107
<strong>{{question.num}}.</strong> {{ question.text }}
108108
</span>
109109
</ion-label>
110-
<ion-textarea [(ngModel)]="answers[question.name]" [name]="question.name"
111-
[attr.aria-labelledby]="'addon-mod_survey-'+question.name" [required]="question.required">
110+
<ion-textarea [(ngModel)]="answers[question.name]" [name]="question.name" [required]="question.required">
112111
</ion-textarea>
113112
</ion-item>
114113
</ng-container>

src/core/components/group-selector/group-selector.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@
77
</ion-card>
88

99
<ion-item class="ion-text-wrap core-group-selector">
10-
<ion-label id="core-groups-selector-groupslabel-{{id}}">
10+
<ion-label>
1111
<ng-container *ngIf="groupInfo.separateGroups">{{'core.groupsseparate' | translate }}</ng-container>
1212
<ng-container *ngIf="groupInfo.visibleGroups">{{'core.groupsvisible' | translate }}</ng-container>
1313
</ion-label>
14-
<ion-select [(ngModel)]="selected" (ionChange)="selectedChange.emit(selected)"
15-
[attr.aria-labelledby]="'core-groups-selector-groupslabel-' + id" interface="action-sheet"
14+
<ion-select [(ngModel)]="selected" (ionChange)="selectedChange.emit(selected)" interface="action-sheet"
1615
[interfaceOptions]="{header: 'core.group' | translate}">
1716
<ion-select-option *ngFor="let groupOpt of groupInfo.groups" [value]="groupOpt.id">
1817
{{groupOpt.name}}

src/core/components/group-selector/group-selector.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
import { Component, Input, Output, EventEmitter, OnInit, ChangeDetectionStrategy } from '@angular/core';
15+
import { Component, Input, Output, EventEmitter, ChangeDetectionStrategy } from '@angular/core';
1616
import { CoreGroupInfo } from '@services/groups';
17-
import { CoreUtils } from '@services/utils/utils';
1817

1918
/**
2019
* Component to display a group selector.
@@ -24,20 +23,11 @@ import { CoreUtils } from '@services/utils/utils';
2423
templateUrl: 'group-selector.html',
2524
changeDetection: ChangeDetectionStrategy.OnPush,
2625
})
27-
export class CoreGroupSelectorComponent implements OnInit {
26+
export class CoreGroupSelectorComponent {
2827

2928
@Input() groupInfo?: CoreGroupInfo;
3029
@Input() multipleGroupsMessage?: string;
3130
@Input() selected!: number;
3231
@Output() selectedChange = new EventEmitter<number>();
3332

34-
id!: number;
35-
36-
/**
37-
* @inheritdoc
38-
*/
39-
ngOnInit(): void {
40-
this.id = CoreUtils.getUniqueId('CoreGroupSelectorComponent');
41-
}
42-
4333
}

src/core/features/login/pages/email-signup/email-signup.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,8 @@ <h3>{{ 'core.login.supplyinfo' | translate }}</h3>
159159
</ion-input>
160160
</ion-item>
161161
<ion-item class="ion-text-wrap">
162-
<ion-label position="stacked" id="core-login-signup-country">{{ 'core.user.country' | translate }}</ion-label>
163-
<ion-select name="country" formControlName="country" aria-labelledby="core-login-signup-country"
164-
[placeholder]="'core.login.selectacountry' | translate">
162+
<ion-label position="stacked">{{ 'core.user.country' | translate }}</ion-label>
163+
<ion-select name="country" formControlName="country" [placeholder]="'core.login.selectacountry' | translate">
165164

166165
<ion-select-option value="">{{ 'core.login.selectacountry' | translate }}</ion-select-option>
167166
<ion-select-option *ngFor="let country of countries" [value]="country.code">{{country.name}}</ion-select-option>

0 commit comments

Comments
 (0)