Skip to content

Commit

Permalink
Revert "fix(material/menu): not interrupting keyboard events to other…
Browse files Browse the repository at this point in the history
… overlays (#22856)" (#22924)

This reverts commit aeecb3c.

(cherry picked from commit 764c150)
  • Loading branch information
andrewseguin committed Jun 9, 2021
1 parent 38aeb86 commit cc36883
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 9 deletions.
2 changes: 0 additions & 2 deletions src/material-experimental/mdc-menu/menu.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down
2 changes: 0 additions & 2 deletions src/material/menu/menu.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,15 +436,13 @@ describe('MatMenu', () => {

const panel = overlayContainerElement.querySelector('.mat-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(() => {
Expand Down
5 changes: 0 additions & 5 deletions src/material/menu/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,12 +341,7 @@ export class _MatMenuBase implements AfterContentInit, MatMenuPanel<MatMenuItem>
}

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();
}

/**
Expand Down

0 comments on commit cc36883

Please sign in to comment.