Plotly hovermode changes behavior of plotly_click

I’ve got a plotly graph and am trying to use plotly_click to select and unselect individual points. This works fine when the hovermode: closest is enabled, and data.points returned by plotly click only contains a single array that is the series of points I clicked. If I switch to hovermode: x unified data.points now returns an array of arrays, one for each series of points in the graph, and it isn’t possible to tell which series was clicked.

Here’s a codepen that shows this behavior: https://codepen.io/occam98/pen/abYrYmV change link 11 to ‘x unified’ and inspect the data object in the console to see this.

Is there a workaround for this? Ideally, I’d like to continue to use the x unified hovermode, but have plotly_click only return the series that was clicked, or have some other way to identify which point was clicked.

Is there any follow-up to this problem? How to solve it? I also encountered this problem…

Check this