Skip to content

Commit ca44093

Browse files
authored
fix(material): fix invalid ARIA attributes in MultiCheckbox type (#3144)
fix #3004
1 parent 6b95b50 commit ca44093

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

demo/src/app/app.component.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
<ngx-loading-bar [color]="'#fafafa'"></ngx-loading-bar>
2-
32
<mat-toolbar color="primary" class="mat-elevation-z6 app-navbar" [class.navbar-small]="isSmallDevice$ | async">
43
<a mat-button routerLink="" routerLinkActive="" #homeLink="routerLinkActive"
54
[routerLinkActiveOptions]="{ exact: true }">
6-
<img src="https://raw.githubusercontent.com/ngx-formly/ngx-formly/v5/logo.svg?sanitize=true">
5+
<img alt="Home" src="https://raw.githubusercontent.com/ngx-formly/ngx-formly/v5/logo.svg?sanitize=true">
76
FORMLY
87
</a>
98

109
<ng-container *ngIf="isSmallDevice$ | async else mainMenu">
1110
<span class="spacer" [style.flex]="'1 1 auto'"></span>
1211
<ng-container *ngTemplateOutlet="version"></ng-container>
1312
<a mat-button href="https://github.com/ngx-formly/ngx-formly">
14-
<img src="https://material.angular.io/assets/img/homepage/github-circle-white-transparent.svg">
13+
<img alt="GitHub" src="https://material.angular.io/assets/img/homepage/github-circle-white-transparent.svg">
1514
</a>
1615
<button mat-button (click)="sidenav.toggle()">
1716
<mat-icon>menu</mat-icon>
@@ -23,7 +22,7 @@
2322

2423
<ng-container *ngTemplateOutlet="version"></ng-container>
2524
<a mat-button href="https://github.com/ngx-formly/ngx-formly">
26-
<img src="https://material.angular.io/assets/img/homepage/github-circle-white-transparent.svg">
25+
<img alt="GitHub" src="https://material.angular.io/assets/img/homepage/github-circle-white-transparent.svg">
2726
GitHub
2827
</a>
2928
</ng-template>
@@ -73,7 +72,7 @@
7372
[routerLinkActiveOptions]="{ exact: true }">
7473

7574
<span class="bd-footer-logo">
76-
<img width="60" src="https://raw.githubusercontent.com/ngx-formly/ngx-formly/v5/logo.svg?sanitize=true">
75+
<img width="60" alt="Home" src="https://raw.githubusercontent.com/ngx-formly/ngx-formly/v5/logo.svg?sanitize=true">
7776
<span class="bd-footer-logo-text">
7877
FORMLY
7978
</span>

demo/src/app/shared/example-viewer/example-viewer.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<div class="docs-example-viewer-wrapper">
22
<div class="docs-example-viewer-title">
33
<div class="docs-example-viewer-title-spacer">{{ exampleData.title }}</div>
4-
<button *ngIf="exampleData.debug && _debugFields" mat-icon-button type="button" (click)="toggleDebugView()" [matTooltip]="'Debug'">
4+
<button *ngIf="exampleData.debug && _debugFields" mat-icon-button type="button" (click)="toggleDebugView()" [matTooltip]="'Debug'" aria-label="Debug example source">
55
<mat-icon>bug_report</mat-icon>
66
</button>
77
<formly-stackblitz-button [type]="type" [example]="exampleData"></formly-stackblitz-button>
8-
<button mat-icon-button type="button" (click)="toggleSourceView()" [matTooltip]="'View source'">
8+
<button mat-icon-button type="button" (click)="toggleSourceView()" [matTooltip]="'View source'" aria-label="View example source">
99
<mat-icon>
1010
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 24 24" fit="" preserveAspectRatio="xMidYMid meet"
1111
focusable="false">
Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
<div [matTooltip]="'Edit in StackBlitz'">
2-
<button mat-icon-button type="button" (click)="openStackblitz()">
3-
<mat-icon>
4-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 184.4 150.8">
5-
<g>
6-
<path d="M119.8.3L49 76.1h37l-21.3 53.4 70.8-75.8H98.3z" />
7-
<path d="M123 4l-8.8 21 40 40-34.4 34.7v29.8L184.2 65zM64.7.3v29.8L30.2 65l40 39.8-8.7 21.3L.2 65z" />
8-
</g>
9-
</svg>
10-
</mat-icon>
11-
</button>
12-
</div>
1+
<button mat-icon-button type="button" (click)="openStackblitz()" [matTooltip]="'Edit in StackBlitz'" aria-label="Edit this example in StackBlitz">
2+
<mat-icon>
3+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 184.4 150.8">
4+
<g>
5+
<path d="M119.8.3L49 76.1h37l-21.3 53.4 70.8-75.8H98.3z" />
6+
<path d="M123 4l-8.8 21 40 40-34.4 34.7v29.8L184.2 65zM64.7.3v29.8L30.2 65l40 39.8-8.7 21.3L.2 65z" />
7+
</g>
8+
</svg>
9+
</mat-icon>
10+
</button>

src/material/multicheckbox/src/multicheckbox.type.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ import { MatCheckbox } from '@angular/material/checkbox';
1919
</mat-checkbox>
2020
</ng-container>
2121
`,
22+
host: {
23+
'[id]': 'id',
24+
},
2225
})
2326
export class FormlyFieldMultiCheckbox extends FieldType {
2427
@ViewChildren(MatCheckbox) checkboxes!: QueryList<MatCheckbox>;

0 commit comments

Comments
 (0)