-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Ploty.js in Shadow DOM hover flicker #5277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@alexandergerber to clarify, this is occurring within a ShadowDOM element and the behavior is not exhibited in normal "LightDOM" elements? |
@dbluhm Yes. I am trying to use plotly within a Web Component. Outside ShadowDOM elements it works correctly. |
@alexandergerber does the codepen I shared also encapsulate your findings? If not, would you be able to provide one that does? I think that would help ensure we're looking at the same issue. It might also be interesting to try out changes from the (incomplete) PR I have open addressing this issue and seeing if that fixes the behavior you're seeing on the other graphs |
I would say it is exactly the same issue. I checked out your pull request and can try if it fixes the problem for me. |
We tested this and it seems not to work for our plots. It seems that the problem only occurs in the lower part of the plot and also only at specific pixels. |
unfortunately we also have the same problem. the unhover event gets fired even if the mouse is on the box or the bar. I have added here some screenshots from the code and hopefully someone can help fix this issue soon. the Tooltip disappears back and forth because of the unhover event.the function where we listen to the unhover event from plotlythe function where we fetch the html div element from the shadow root |
It seems working on this codepen. |
it does not work as expected in the codepin that you sent me either. the tooltip disappears frequently even if iam still on the bar. this codepen prints in console the unhover events. you can see that the unhover event gets fired over and over again with the mouse being on the bars. i hope this could help. |
Fixed by #5256. |
I don't think this should have been closed. I just tested it with 2.0 and the problem still persists. |
Just upgraded to version 2.2.0 - problem is still there! |
Is there any update on this? I use version 2.33.0 and the issue still happens. |
When Plotly.js is rendered inside of a ShadowDOM, the hover elements rapidly draw, clear, and redraw causing a flickering effect on
mousemove
events under specific conditions.Demonstration in codepen
And a GIF

For comparision, here is the same example as above using the Light DOM:
Demonstration in codepen
And a GIF

When it comes to support for Plotly.js in Shadow DOM, there are other issues in addition to this one but, as demonstrated in the first code pen, there are workable fixes I can make as a user in most cases (i.e. the styling inside of the template...) but this particular issue is not so easily worked around as a user.
The text was updated successfully, but these errors were encountered: