Skip to content

Commit

Permalink
fix(select): set aria-multiselectable for multi-select
Browse files Browse the repository at this point in the history
Sets the `aria-multiselectable` attribute to multi-select instances, as per https://www.w3.org/TR/wai-aria-practices-1.1/#Listbox.
  • Loading branch information
crisbeto committed Aug 2, 2017
1 parent 3bfe7f0 commit e453d19
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/lib/select/select.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1904,6 +1904,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', () => {
Expand Down
1 change: 1 addition & 0 deletions src/lib/select/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,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',
Expand Down

0 comments on commit e453d19

Please sign in to comment.