Simple Dash app with a dropdown menu and an a graph. The graph changes with the dropdown selection. The graph shows hover data as usual and works perfectly on a computer.
When used on mobile / tablet the hover info shows up when a data point is clicked. The hover info lingers until you click somewhere else, even if the graph is change using the dropdown.
Here is a minimal working example. On touch interface, the hover info is sticky when the dropdown value and source graph are changed. I’ve tried using various parameters like clear_on_unhover, hoverData, hoverinfo, selectedpoints. Looks like the interaction gets captured as a click on touch so I tried to work with properties like clickData. Ideally, looking for the label to disappear when the dropdown is changed so it isn’t referencing the incorrect data point on the graph. thanks guys!
Lots of sample apps and documentation examples seem to work the same way. This sample app on the dash gallery seems to work around the issue if you check out the first two graphs and change the dropdowns.
Hey, I know this post is pretty old, but I was having the same issue and saw this post, as well as a bug report on github. After some playing around, I found that if I returned the entire dcc.graph component in my callback and gave the component a unique id (which I did with python’s time module), whenever I called the function and updated the graph, the popup would no longer be sticky on my phone.
This exact way wouldn’t work if you needed to use the graph in an input, but you may be able to use pattern matching callbacks and change the id to be a dictionary with a standard type and varying id to make the graph a usable input. (This link explains this better: https://dash.plotly.com/pattern-matching-callbacks)