1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

fix refreshPosition

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton 2021-04-26 16:27:44 -04:00
parent 650b24c1f0
commit 931259b731

View File

@ -122,7 +122,10 @@ export class Menu extends React.Component<MenuProps, State> {
}
refreshPosition = () => {
if (!this.props.usePortal || !this.opener) return;
if (!this.props.usePortal || !this.opener || !this.elem) {
return;
}
const { width, height } = this.opener.getBoundingClientRect();
let { left, top, bottom, right } = this.opener.getBoundingClientRect();
const withScroll = window.getComputedStyle(this.elem).position !== "fixed";