diff --git a/src/material-experimental/mdc-menu/menu.spec.ts b/src/material-experimental/mdc-menu/menu.spec.ts index 84f57591c88a..d310f46000f8 100644 --- a/src/material-experimental/mdc-menu/menu.spec.ts +++ b/src/material-experimental/mdc-menu/menu.spec.ts @@ -439,7 +439,6 @@ describe('MDC-based MatMenu', () => { const panel = overlayContainerElement.querySelector('.mat-mdc-menu-panel')!; const event = createKeyboardEvent('keydown', ESCAPE); - spyOn(event, 'stopPropagation').and.callThrough(); dispatchEvent(panel, event); fixture.detectChanges(); @@ -447,7 +446,6 @@ describe('MDC-based MatMenu', () => { expect(overlayContainerElement.textContent).toBe(''); expect(event.defaultPrevented).toBe(true); - expect(event.stopPropagation).toHaveBeenCalled(); })); it('should not close the menu when pressing ESCAPE with a modifier', fakeAsync(() => { diff --git a/src/material/menu/menu.spec.ts b/src/material/menu/menu.spec.ts index 4c9d4c32be18..cb5c593dbc9b 100644 --- a/src/material/menu/menu.spec.ts +++ b/src/material/menu/menu.spec.ts @@ -440,7 +440,6 @@ describe('MatMenu', () => { const panel = overlayContainerElement.querySelector('.mat-menu-panel')!; const event = createKeyboardEvent('keydown', ESCAPE); - spyOn(event, 'stopPropagation').and.callThrough(); dispatchEvent(panel, event); fixture.detectChanges(); @@ -448,7 +447,6 @@ describe('MatMenu', () => { expect(overlayContainerElement.textContent).toBe(''); expect(event.defaultPrevented).toBe(true); - expect(event.stopPropagation).toHaveBeenCalled(); })); it('should not close the menu when pressing ESCAPE with a modifier', fakeAsync(() => { diff --git a/src/material/menu/menu.ts b/src/material/menu/menu.ts index 9068383c6ee3..85a1d9a034f6 100644 --- a/src/material/menu/menu.ts +++ b/src/material/menu/menu.ts @@ -337,12 +337,7 @@ export class _MatMenuBase implements AfterContentInit, MatMenuPanel } manager.onKeydown(event); - return; } - - // Don't allow the event to propagate if we've already handled it, or it may - // end up reaching other overlays that were opened earlier (see #22694). - event.stopPropagation(); } /**