Skip to content

Commit 77aa54c

Browse files
committed
Fix mousemove actions
1 parent bfaf905 commit 77aa54c

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/plots/cartesian/graph_interact.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -117,20 +117,17 @@ fx.init = function(gd) {
117117
// This is on `gd._fullLayout`, *not* fullLayout because the reference
118118
// changes by the time this is called again.
119119
gd._fullLayout._rehover = function() {
120-
if(gd._fullLayout._hoversubplot === plotinfo.id) {
120+
if(gd._fullLayout._hoversubplot === subplot) {
121121
fx.hover(gd, evt, subplot);
122122
}
123123
};
124124

125-
// Track the hovered subplot. This prevents rehover from accidetally
126-
// reapplying a hover label after the mouse has left the plot or if
127-
// the mouse has entered another subplot.
128-
gd._fullLayout._hoversubplot = plotinfo.id;
125+
fx.hover(gd, evt, subplot);
129126

130-
gd._fullLayout._rehover();
131-
132-
fullLayout._lasthover = maindrag;
133-
fullLayout._hoversubplot = subplot;
127+
// Not that we have *not* used the cached fullLayout variable here
128+
// since that may be outdated when this is called as a callback later on
129+
gd._fullLayout._lasthover = maindrag;
130+
gd._fullLayout._hoversubplot = subplot;
134131
};
135132

136133
/*

0 commit comments

Comments
 (0)