Fixed tooltip (#74074)

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
Uladzislau Lasitsa 2020-08-13 16:38:57 +03:00 committed by GitHub
parent 50f332867a
commit acc8ffed29
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -107,6 +107,7 @@
.vgaVis__tooltip {
max-width: 100%;
position: fixed;
h2 {
margin-bottom: $euiSizeS;

View file

@ -85,12 +85,12 @@ export class TooltipHandler {
let anchorBounds;
if (item.bounds.width() > this.centerOnMark || item.bounds.height() > this.centerOnMark) {
// I would expect clientX/Y, but that shows incorrectly
anchorBounds = createRect(event.pageX, event.pageY, 0, 0);
anchorBounds = createRect(event.clientX, event.clientY, 0, 0);
} else {
const containerBox = this.container.getBoundingClientRect();
anchorBounds = createRect(
containerBox.left + view._origin[0] + item.bounds.x1 + window.pageXOffset,
containerBox.top + view._origin[1] + item.bounds.y1 + window.pageYOffset,
containerBox.left + view._origin[0] + item.bounds.x1,
containerBox.top + view._origin[1] + item.bounds.y1,
item.bounds.width(),
item.bounds.height()
);