Skip to content

Commit cc36883

Browse files
committed
Revert "fix(material/menu): not interrupting keyboard events to other overlays (#22856)" (#22924)
This reverts commit aeecb3c. (cherry picked from commit 764c150)
1 parent 38aeb86 commit cc36883

File tree

3 files changed

+0
-9
lines changed

3 files changed

+0
-9
lines changed

src/material-experimental/mdc-menu/menu.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,14 +437,12 @@ describe('MDC-based MatMenu', () => {
437437
const panel = overlayContainerElement.querySelector('.mat-mdc-menu-panel')!;
438438
const event = createKeyboardEvent('keydown', ESCAPE);
439439

440-
spyOn(event, 'stopPropagation').and.callThrough();
441440
dispatchEvent(panel, event);
442441
fixture.detectChanges();
443442
tick(500);
444443

445444
expect(overlayContainerElement.textContent).toBe('');
446445
expect(event.defaultPrevented).toBe(true);
447-
expect(event.stopPropagation).toHaveBeenCalled();
448446
}));
449447

450448
it('should not close the menu when pressing ESCAPE with a modifier', fakeAsync(() => {

src/material/menu/menu.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,15 +436,13 @@ describe('MatMenu', () => {
436436

437437
const panel = overlayContainerElement.querySelector('.mat-menu-panel')!;
438438
const event = createKeyboardEvent('keydown', ESCAPE);
439-
spyOn(event, 'stopPropagation').and.callThrough();
440439

441440
dispatchEvent(panel, event);
442441
fixture.detectChanges();
443442
tick(500);
444443

445444
expect(overlayContainerElement.textContent).toBe('');
446445
expect(event.defaultPrevented).toBe(true);
447-
expect(event.stopPropagation).toHaveBeenCalled();
448446
}));
449447

450448
it('should not close the menu when pressing ESCAPE with a modifier', fakeAsync(() => {

src/material/menu/menu.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -341,12 +341,7 @@ export class _MatMenuBase implements AfterContentInit, MatMenuPanel<MatMenuItem>
341341
}
342342

343343
manager.onKeydown(event);
344-
return;
345344
}
346-
347-
// Don't allow the event to propagate if we've already handled it, or it may
348-
// end up reaching other overlays that were opened earlier (see #22694).
349-
event.stopPropagation();
350345
}
351346

352347
/**

0 commit comments

Comments
 (0)