From 877ef5d73890e4609e85673156c320d197f6ff37 Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Thu, 27 Sep 2018 16:09:11 +0200 Subject: [PATCH] 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. --- src/lib/list/selection-list.spec.ts | 5 +++++ src/lib/list/selection-list.ts | 1 + 2 files changed, 6 insertions(+) diff --git a/src/lib/list/selection-list.spec.ts b/src/lib/list/selection-list.spec.ts index 86bab1bb0a7..7d5419cc162 100644 --- a/src/lib/list/selection-list.spec.ts +++ b/src/lib/list/selection-list.spec.ts @@ -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', () => { diff --git a/src/lib/list/selection-list.ts b/src/lib/list/selection-list.ts index 322e4c30c5b..dd282d10b64 100644 --- a/src/lib/list/selection-list.ts +++ b/src/lib/list/selection-list.ts @@ -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: '',