From 931259b731a41fbe8d0fde89ff6844a201c7a7c3 Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Mon, 26 Apr 2021 16:27:44 -0400 Subject: [PATCH] fix refreshPosition Signed-off-by: Sebastian Malton --- src/renderer/components/menu/menu.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/renderer/components/menu/menu.tsx b/src/renderer/components/menu/menu.tsx index 049d80c35c..f0d172b0d7 100644 --- a/src/renderer/components/menu/menu.tsx +++ b/src/renderer/components/menu/menu.tsx @@ -122,7 +122,10 @@ export class Menu extends React.Component { } 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";