mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
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:
committed by
tinayuangao
parent
1748397d83
commit
ce311136ef
@@ -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', () => {
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user