Skip to content

Commit 5fd88d7

Browse files
authored
fix(compass-serverstats): prevent mouse cursor jumping COMPASS-4432 (#2281)
1 parent 5324c45 commit 5fd88d7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/compass-serverstats/src/d3/real-time-mouse-overlay.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function realTimeMouseOverlay() {
5454
.attr('height', height - (bubbleWidth / 2))
5555
.attr('width', width - bubbleWidth);
5656

57-
mouseTarget.enter()
57+
const mouseTargetEnter = mouseTarget.enter()
5858
.append('rect')
5959
.attr('class', `${prefix}-mouse-target`)
6060
.attr('fill', 'none')
@@ -63,7 +63,7 @@ function realTimeMouseOverlay() {
6363
.style('pointer-events', 'visible');
6464

6565
if (enableMouse) {
66-
mouseTarget
66+
mouseTargetEnter
6767
.on('mouseover', function() {
6868
const xPosition = d3.mouse(this)[0];
6969
eventDispatcher.mouseover(xPosition);
@@ -74,7 +74,7 @@ function realTimeMouseOverlay() {
7474
eventDispatcher.mouseout(basePosition);
7575
});
7676
} else {
77-
mouseTarget
77+
mouseTargetEnter
7878
.on('mouseover', null)
7979
.on('mousemove', null)
8080
.on('mouseout', null);

0 commit comments

Comments
 (0)