mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
fix(list): set aria-multiselectable on selection list (#13325)
The `mat-selection-list` is set up as a listbox, however we never set `aria-multiselectable`, which means that the element is assumed to be single selection. These changes add `aria-multiselectable="true"` since selection lists are always multi-selection.
This commit is contained in:
committed by
Jeremy Elbourn
parent
b5001f62c5
commit
877ef5d738
@@ -431,6 +431,11 @@ describe('MatSelectionList without forms', () => {
|
||||
|
||||
expect(item.selected).toBe(true);
|
||||
});
|
||||
|
||||
it('should set aria-multiselectable to true on the selection list element', () => {
|
||||
expect(selectionList.nativeElement.getAttribute('aria-multiselectable')).toBe('true');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('with list option selected', () => {
|
||||
|
||||
@@ -264,6 +264,7 @@ export class MatListOption extends _MatListOptionMixinBase
|
||||
'(focus)': 'focus()',
|
||||
'(blur)': '_onTouched()',
|
||||
'(keydown)': '_keydown($event)',
|
||||
'aria-multiselectable': 'true',
|
||||
'[attr.aria-disabled]': 'disabled.toString()',
|
||||
},
|
||||
template: '<ng-content></ng-content>',
|
||||
|
||||
Reference in New Issue
Block a user