Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/material-experimental/mdc-checkbox/checkbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
<div class="mdc-checkbox__background">
<svg class="mdc-checkbox__checkmark"
focusable="false"
viewBox="0 0 24 24">
viewBox="0 0 24 24"
aria-hidden="true">
<path class="mdc-checkbox__checkmark-path"
fill="none"
d="M1.73,12.91 8.1,19.28 22.79,4.59"/>
Expand Down
5 changes: 5 additions & 0 deletions src/material-experimental/mdc-checkbox/checkbox.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ describe('MDC-based MatCheckbox', () => {
expect(checkboxInstance.ripple).toBeTruthy();
});

it('should hide the internal SVG', () => {
const svg = checkboxNativeElement.querySelector('svg')!;
expect(svg.getAttribute('aria-hidden')).toBe('true');
});

it('should toggle checkbox ripple disabledness correctly', fakeAsync(() => {
const rippleSelector = '.mat-ripple-element:not(.mat-checkbox-persistent-ripple)';

Expand Down
3 changes: 2 additions & 1 deletion src/material-experimental/mdc-list/list-option.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
[checked]="selected" [disabled]="disabled"/>
<div class="mdc-checkbox__background">
<svg class="mdc-checkbox__checkmark"
viewBox="0 0 24 24">
viewBox="0 0 24 24"
aria-hidden="true">
<path class="mdc-checkbox__checkmark-path"
fill="none"
d="M1.73,12.91 8.1,19.28 22.79,4.59"/>
Expand Down
7 changes: 7 additions & 0 deletions src/material-experimental/mdc-list/selection-list.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,13 @@ describe('MDC-based MatSelectionList without forms', () => {
.every(element => element.querySelector('.mat-mdc-focus-indicator') !== null)).toBe(true);
});

it('should hide the internal SVG', () => {
listOptions.forEach(option => {
const svg = option.nativeElement.querySelector('.mdc-checkbox svg');
expect(svg.getAttribute('aria-hidden')).toBe('true');
});
});

});

describe('with list option selected', () => {
Expand Down
3 changes: 2 additions & 1 deletion src/material/checkbox/checkbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
focusable="false"
class="mat-checkbox-checkmark"
viewBox="0 0 24 24"
xml:space="preserve">
xml:space="preserve"
aria-hidden="true">
<path class="mat-checkbox-checkmark-path"
fill="none"
stroke="white"
Expand Down
5 changes: 5 additions & 0 deletions src/material/checkbox/checkbox.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ describe('MatCheckbox', () => {
expect(checkboxInstance.ripple).toBeTruthy();
});

it('should hide the internal SVG', () => {
const svg = checkboxNativeElement.querySelector('svg')!;
expect(svg.getAttribute('aria-hidden')).toBe('true');
});

it('should add and remove indeterminate state', () => {
expect(checkboxNativeElement.classList).not.toContain('mat-checkbox-checked');
expect(inputElement.checked).toBe(false);
Expand Down