From 44b53679566776cc6cf1dbd911bf5df4512743f7 Mon Sep 17 00:00:00 2001 From: Andrew Seguin Date: Tue, 8 Jun 2021 15:38:47 -0600 Subject: [PATCH] Revert "fix(material/menu): not interrupting keyboard events to other overlays (#22856)" This reverts commit aeecb3ccbde1e679766c7bcc2ba4b2e483c27ac2. --- src/material-experimental/mdc-menu/menu.spec.ts | 2 -- src/material/menu/menu.spec.ts | 2 -- src/material/menu/menu.ts | 5 ----- 3 files changed, 9 deletions(-) diff --git a/src/material-experimental/mdc-menu/menu.spec.ts b/src/material-experimental/mdc-menu/menu.spec.ts index 5673468bcafd..ac003751e194 100644 --- a/src/material-experimental/mdc-menu/menu.spec.ts +++ b/src/material-experimental/mdc-menu/menu.spec.ts @@ -437,14 +437,12 @@ 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(); tick(500); 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 21c77c9aa6cb..b368ccbcb984 100644 --- a/src/material/menu/menu.spec.ts +++ b/src/material/menu/menu.spec.ts @@ -436,7 +436,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(); @@ -444,7 +443,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 e9966aba4656..bacd6b63f634 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(); } /**