Skip to content

Commit acc8ffe

Browse files
Fixed tooltip (#74074)
Co-authored-by: Elastic Machine <[email protected]>
1 parent 50f3328 commit acc8ffe

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/plugins/vis_type_vega/public/_vega_vis.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107

108108
.vgaVis__tooltip {
109109
max-width: 100%;
110+
position: fixed;
110111

111112
h2 {
112113
margin-bottom: $euiSizeS;

src/plugins/vis_type_vega/public/vega_view/vega_tooltip.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ export class TooltipHandler {
8585
let anchorBounds;
8686
if (item.bounds.width() > this.centerOnMark || item.bounds.height() > this.centerOnMark) {
8787
// I would expect clientX/Y, but that shows incorrectly
88-
anchorBounds = createRect(event.pageX, event.pageY, 0, 0);
88+
anchorBounds = createRect(event.clientX, event.clientY, 0, 0);
8989
} else {
9090
const containerBox = this.container.getBoundingClientRect();
9191
anchorBounds = createRect(
92-
containerBox.left + view._origin[0] + item.bounds.x1 + window.pageXOffset,
93-
containerBox.top + view._origin[1] + item.bounds.y1 + window.pageYOffset,
92+
containerBox.left + view._origin[0] + item.bounds.x1,
93+
containerBox.top + view._origin[1] + item.bounds.y1,
9494
item.bounds.width(),
9595
item.bounds.height()
9696
);

0 commit comments

Comments
 (0)