diff --git a/src/material/list/selection-list.spec.ts b/src/material/list/selection-list.spec.ts index f106c895ab44..51326f144cae 100644 --- a/src/material/list/selection-list.spec.ts +++ b/src/material/list/selection-list.spec.ts @@ -1160,16 +1160,27 @@ describe('MatSelectionList with forms', () => { .toBe(1, 'Expected first list option to be selected'); })); - it('should set the selection-list to touched on blur', fakeAsync(() => { + it('should not mark the model as touched when the list is blurred', fakeAsync(() => { expect(ngModel.touched) .toBe(false, 'Expected the selection-list to be untouched by default.'); dispatchFakeEvent(selectionListDebug.nativeElement, 'blur'); fixture.detectChanges(); + tick(); + + expect(ngModel.touched).toBe(false, 'Expected the selection-list to remain untouched.'); + })); + + it('should mark the model as touched when a list item is blurred', fakeAsync(() => { + expect(ngModel.touched) + .toBe(false, 'Expected the selection-list to be untouched by default.'); + dispatchFakeEvent(fixture.nativeElement.querySelector('.mat-list-option'), 'blur'); + fixture.detectChanges(); tick(); - expect(ngModel.touched).toBe(true, 'Expected the selection-list to be touched after blur'); + expect(ngModel.touched) + .toBe(true, 'Expected the selection-list to be touched after an item is blurred.'); })); it('should be pristine by default', fakeAsync(() => { diff --git a/src/material/list/selection-list.ts b/src/material/list/selection-list.ts index 938c58aef01f..9a42ca215b43 100644 --- a/src/material/list/selection-list.ts +++ b/src/material/list/selection-list.ts @@ -325,7 +325,6 @@ export class MatListOption extends _MatListOptionMixinBase implements AfterConte 'role': 'listbox', 'class': 'mat-selection-list mat-list-base', '(focus)': '_onFocus()', - '(blur)': '_onTouched()', '(keydown)': '_keydown($event)', '[attr.aria-multiselectable]': 'multiple', '[attr.aria-disabled]': 'disabled.toString()',