Skip to content

Commit

Permalink
fix(menu): getBoundingClientRect() and getClientRects() not working
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 634601756
  • Loading branch information
material-web-copybara authored and copybara-github committed May 17, 2024
1 parent 930883d commit e1f9cbc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions menu/internal/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,20 @@ export abstract class Menu extends LitElement {
this.cleanUpGlobalEventListeners();
}

override getBoundingClientRect() {
if (!this.surfaceEl) {
return super.getBoundingClientRect();
}
return this.surfaceEl.getBoundingClientRect();
}

override getClientRects() {
if (!this.surfaceEl) {
return super.getClientRects();
}
return this.surfaceEl.getClientRects();
}

protected override render() {
return this.renderSurface();
}
Expand Down

0 comments on commit e1f9cbc

Please sign in to comment.