Skip to content

Commit

Permalink
Fixed tooltip (#74074)
Browse files Browse the repository at this point in the history
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
VladLasitsa and elasticmachine committed Aug 13, 2020
1 parent 50f3328 commit acc8ffe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/plugins/vis_type_vega/public/_vega_vis.scss
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@

.vgaVis__tooltip {
max-width: 100%;
position: fixed;

h2 {
margin-bottom: $euiSizeS;
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/vis_type_vega/public/vega_view/vega_tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
);
Expand Down

0 comments on commit acc8ffe

Please sign in to comment.