Skip to content

Commit 877ef5d

Browse files
crisbetojelbourn
authored andcommitted
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.
1 parent b5001f6 commit 877ef5d

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/lib/list/selection-list.spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,11 @@ describe('MatSelectionList without forms', () => {
431431

432432
expect(item.selected).toBe(true);
433433
});
434+
435+
it('should set aria-multiselectable to true on the selection list element', () => {
436+
expect(selectionList.nativeElement.getAttribute('aria-multiselectable')).toBe('true');
437+
});
438+
434439
});
435440

436441
describe('with list option selected', () => {

src/lib/list/selection-list.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ export class MatListOption extends _MatListOptionMixinBase
264264
'(focus)': 'focus()',
265265
'(blur)': '_onTouched()',
266266
'(keydown)': '_keydown($event)',
267+
'aria-multiselectable': 'true',
267268
'[attr.aria-disabled]': 'disabled.toString()',
268269
},
269270
template: '<ng-content></ng-content>',

0 commit comments

Comments
 (0)