fix(select): set aria-multiselectable for multi-select (#6110)

Sets the `aria-multiselectable` attribute to multi-select instances, as per https://www.w3.org/TR/wai-aria-practices-1.1/#Listbox.
This commit is contained in:
Kristiyan Kostadinov
2017-08-03 00:50:40 +02:00
committed by tinayuangao
parent 1748397d83
commit ce311136ef
2 changed files with 16 additions and 0 deletions
+15
View File
@@ -1915,6 +1915,21 @@ describe('MdSelect', () => {
.toBe('true', 'Expected aria-hidden to be true when the select is open.');
});
it('should set `aria-multiselectable` to true on multi-select instances', () => {
fixture.destroy();
const multiFixture = TestBed.createComponent(MultiSelect);
multiFixture.detectChanges();
select = multiFixture.debugElement.query(By.css('md-select')).nativeElement;
expect(select.getAttribute('aria-multiselectable')).toBe('true');
});
it('should set `aria-multiselectable` false on single-selection instances', () => {
expect(select.getAttribute('aria-multiselectable')).toBe('false');
});
});
describe('for options', () => {
+1
View File
@@ -164,6 +164,7 @@ export const _MdSelectMixinBase = mixinColor(mixinDisabled(MdSelectBase), 'prima
'[attr.aria-disabled]': 'disabled.toString()',
'[attr.aria-invalid]': '_isErrorState()',
'[attr.aria-owns]': '_optionIds',
'[attr.aria-multiselectable]': 'multiple',
'[class.mat-select-disabled]': 'disabled',
'[class.mat-select-invalid]': '_isErrorState()',
'[class.mat-select-required]': 'required',