Skip to content

Commit e1f9cbc

Browse files
fix(menu): getBoundingClientRect() and getClientRects() not working
PiperOrigin-RevId: 634601756
1 parent 930883d commit e1f9cbc

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

menu/internal/menu.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,20 @@ export abstract class Menu extends LitElement {
461461
this.cleanUpGlobalEventListeners();
462462
}
463463

464+
override getBoundingClientRect() {
465+
if (!this.surfaceEl) {
466+
return super.getBoundingClientRect();
467+
}
468+
return this.surfaceEl.getBoundingClientRect();
469+
}
470+
471+
override getClientRects() {
472+
if (!this.surfaceEl) {
473+
return super.getClientRects();
474+
}
475+
return this.surfaceEl.getClientRects();
476+
}
477+
464478
protected override render() {
465479
return this.renderSurface();
466480
}

0 commit comments

Comments
 (0)