Skip to content

Commit

Permalink
fix(menu-surface): do not close menu when viewport is resized
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianschmidt committed Nov 13, 2024
1 parent bd6c521 commit 2ef5d8c
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions src/components/menu-surface/menu-surface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,6 @@ export class MenuSurface {
capture: true,
});
this.host.addEventListener('keydown', this.handleKeyDown);
window.addEventListener('resize', this.handleResize, {
passive: true,
});
};

private teardown = () => {
Expand All @@ -101,7 +98,6 @@ export class MenuSurface {
capture: true,
});
this.host.removeEventListener('keydown', this.handleKeyDown);
window.removeEventListener('resize', this.handleResize);
};

private handleDocumentClick = (event) => {
Expand Down Expand Up @@ -129,12 +125,6 @@ export class MenuSurface {
this.preventClickEventPropagation();
};

private handleResize = () => {
if (this.open) {
this.dismiss.emit();
}
};

private preventClickEventPropagation = () => {
// When the menu surface is open, we want to stop the `click` event from propagating
// when clicking outside the surface itself. This is to prevent any dialog that might
Expand Down

0 comments on commit 2ef5d8c

Please sign in to comment.