From 076087f0b2996ec226fd50f9d00d34346807e7e2 Mon Sep 17 00:00:00 2001 From: Benjamin Elo Date: Wed, 21 Aug 2019 04:10:27 -0700 Subject: [PATCH] Fix for button popup menus not rendering Summary: The electron menu popup requires that the position be an integer. Somehow the y-position of the button in the title bar has been moved by half a pixel. Calling Math.floor on the returned values fixes this. Reviewed By: passy Differential Revision: D16936833 fbshipit-source-id: 6abb9add4288f1d64c051ba3e45519340ccbb56e --- src/ui/components/Button.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ui/components/Button.tsx b/src/ui/components/Button.tsx index 0d405ba2f..cdeec7033 100644 --- a/src/ui/components/Button.tsx +++ b/src/ui/components/Button.tsx @@ -285,8 +285,8 @@ class Button extends React.Component { const node = findDOMNode(current); if (node instanceof Element) { const {left, bottom} = node.getBoundingClientRect(); - position.x = left; - position.y = bottom + 6; + position.x = Math.floor(left); + position.y = Math.floor(bottom) + 6; } } menu.popup({