From 5409dd9b14d2310545bafd59062f9579253d4aae Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sun, 4 Oct 2020 20:39:24 -0700 Subject: [PATCH] Fix tooltip max width on larger screens (cherry picked from commit f4f2a6f5fc14244f9acf8186cbacda7f9c1e0481) --- frontend/src/Components/Tooltip/Tooltip.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/frontend/src/Components/Tooltip/Tooltip.js b/frontend/src/Components/Tooltip/Tooltip.js index 11dd100af..6a7cb9e3d 100644 --- a/frontend/src/Components/Tooltip/Tooltip.js +++ b/frontend/src/Components/Tooltip/Tooltip.js @@ -13,19 +13,15 @@ let maxWidth = null; function getMaxWidth() { const windowWidth = window.innerWidth; - if (windowWidth > parseInt(dimensions.breakpointLarge)) { + if (windowWidth >= parseInt(dimensions.breakpointLarge)) { maxWidth = 800; - } - - if (windowWidth > parseInt(dimensions.breakpointMedium)) { + } else if (windowWidth >= parseInt(dimensions.breakpointMedium)) { maxWidth = 650; - } - - if (windowWidth > parseInt(dimensions.breakpointSmall)) { + } else if (windowWidth >= parseInt(dimensions.breakpointSmall)) { maxWidth = 500; + } else { + maxWidth = 450; } - - maxWidth = 450; } class Tooltip extends Component {