fix(menu): getBoundingClientRect() and getClientRects() not working

PiperOrigin-RevId: 634601756
This commit is contained in:
Material Web Team 2024-05-16 19:11:49 -07:00 committed by Copybara-Service
parent 930883d819
commit e1f9cbc59e

View File

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