Skip to content

Commit f2ad1ec

Browse files
committed
fix hover and click selection on subplots with zorder
1 parent 8ed564c commit f2ad1ec

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/components/fx/hover.js

+6
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ var Drawing = require('../drawing');
1515
var Color = require('../color');
1616
var dragElement = require('../dragelement');
1717
var Axes = require('../../plots/cartesian/axes');
18+
var zindexSeparator = require('../../plots/cartesian/constants').zindexSeparator;
1819
var Registry = require('../../registry');
1920

2021
var helpers = require('./helpers');
@@ -261,6 +262,11 @@ exports.loneHover = function loneHover(hoverItems, opts) {
261262
function _hover(gd, evt, subplot, noHoverEvent, eventTarget) {
262263
if(!subplot) subplot = 'xy';
263264

265+
if(typeof subplot === 'string') {
266+
// drop zindex from subplot id
267+
subplot = subplot.split(zindexSeparator)[0];
268+
}
269+
264270
// if the user passed in an array of subplots,
265271
// use those instead of finding overlayed plots
266272
var subplots = Array.isArray(subplot) ? subplot : [subplot];

0 commit comments

Comments
 (0)