Skip to content

Commit e453d19

Browse files
committed
fix(select): set aria-multiselectable for multi-select
Sets the `aria-multiselectable` attribute to multi-select instances, as per https://www.w3.org/TR/wai-aria-practices-1.1/#Listbox.
1 parent 3bfe7f0 commit e453d19

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/lib/select/select.spec.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1904,6 +1904,21 @@ describe('MdSelect', () => {
19041904
.toBe('true', 'Expected aria-hidden to be true when the select is open.');
19051905
});
19061906

1907+
it('should set `aria-multiselectable` to true on multi-select instances', () => {
1908+
fixture.destroy();
1909+
1910+
const multiFixture = TestBed.createComponent(MultiSelect);
1911+
1912+
multiFixture.detectChanges();
1913+
select = multiFixture.debugElement.query(By.css('md-select')).nativeElement;
1914+
1915+
expect(select.getAttribute('aria-multiselectable')).toBe('true');
1916+
});
1917+
1918+
it('should set `aria-multiselectable` false on single-selection instances', () => {
1919+
expect(select.getAttribute('aria-multiselectable')).toBe('false');
1920+
});
1921+
19071922
});
19081923

19091924
describe('for options', () => {

src/lib/select/select.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ export const _MdSelectMixinBase = mixinColor(mixinDisabled(MdSelectBase), 'prima
156156
'[attr.aria-disabled]': 'disabled.toString()',
157157
'[attr.aria-invalid]': '_isErrorState()',
158158
'[attr.aria-owns]': '_optionIds',
159+
'[attr.aria-multiselectable]': 'multiple',
159160
'[class.mat-select-disabled]': 'disabled',
160161
'[class.mat-select-invalid]': '_isErrorState()',
161162
'[class.mat-select-required]': 'required',

0 commit comments

Comments
 (0)