Skip to content

Commit

Permalink
Fixed tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
VladLasitsa committed Aug 3, 2020
1 parent 278d324 commit 9328004
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 9328004

Please sign in to comment.