Skip to content

Commit

Permalink
update tooltip position logic to avoid tooltip getting clipped by top…
Browse files Browse the repository at this point in the history
… of browser window
  • Loading branch information
nreese committed Oct 11, 2017
1 parent 720469f commit 9387f38
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/ui/public/vis/components/tooltip/position_tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 9387f38

Please sign in to comment.