From 9387f3895347ea4dfb783d213739f336948c8178 Mon Sep 17 00:00:00 2001 From: Nathan Reese Date: Wed, 11 Oct 2017 08:39:44 -0600 Subject: [PATCH] update tooltip position logic to avoid tooltip getting clipped by top of browser window --- src/ui/public/vis/components/tooltip/position_tooltip.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ui/public/vis/components/tooltip/position_tooltip.js b/src/ui/public/vis/components/tooltip/position_tooltip.js index 7e1747a409b8a36..463f56bb67e40bc 100644 --- a/src/ui/public/vis/components/tooltip/position_tooltip.js +++ b/src/ui/public/vis/components/tooltip/position_tooltip.js @@ -103,6 +103,13 @@ function mergeOverflows(dest, src) { dest.west = src.west; } } + if (dest.north && dest.south && dest.north > 0 && dest.south > 0 && (src.north < 0 || src.south < 0)) { + if (src.north < src.south) { + dest.north = src.north; + } else { + dest.south = src.south; + } + } } function pickPlacement(prop, pos, overflow, prev, pref, fallback, placement) {