-
Notifications
You must be signed in to change notification settings - Fork 33
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
[BUG] Failed to execute 'getComputedStyle' when using lit #2738
[BUG] Failed to execute 'getComputedStyle' when using lit #2738
Comments
It seems to be related to the shadow dom of lit-element and the way mxGraph detects offsets. The Dom is traversed upwards (
None of them is the case for the shadow dom root of the web component -> the An obvious fix (if possible in your usage context) is to use a container with An reproduction example: https://codesandbox.io/p/sandbox/brave-curie-jhzvd9 But I don't have an idea at the moment how to change the behavior without touching mxGraphs code. |
Thanks for the detailed report and the reproduction environment. However, I know that someone fixed (or at least pretended to fix) this issue:
You may use something like patch-package to locally patch mxGraph with the fix mention above. |
Use patch-package to patch mxGraph and fix process-analytics/bpmn-visualization-js#2738. Built with vite.
I have been able to make it work by patching/fixing mxGraph with patch-package in a dedicated example: process-analytics/bpmn-visualization-examples#507 @xxxLukskyxxx Please let me know if this could work for you. |
After discussion with @csouchet, we decided to not fix We recognize that this problem has an impact on applications that want to integrate If you need more information, don't hesitate to post a comment here. |
@tbouffard Thank you for the fast patch! |
Perfect. I would like to thanks @brendanlaschke again for the analysis and the reproduction environment. The analysis enabled me to quickly recall the existing mxGraph problem. The associated issue proposed a workaround that I was able to use. |
Describe the bug
When the cursor is moved over the container, an error is triggered:
Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.
To Reproduce
Screenshots
Error message in Chrome:
Error message in Firefox:
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: