Skip to content
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

[Workaround] HTML label failing to render in chrome #431

Open
itszn opened this issue Jul 11, 2022 · 0 comments
Open

[Workaround] HTML label failing to render in chrome #431

itszn opened this issue Jul 11, 2022 · 0 comments

Comments

@itszn
Copy link

itszn commented Jul 11, 2022

Some upcoming chrome change has caused html labels to stop rendering correctly. For example this page no longer works on chrome dev:

https://dagrejs.github.io/project/dagre-d3/latest/demo/interactive-demo.html

I believe the issue is with how chrome is rendering the foreignObject node when it is initially created.

Removing this line seems to fix the issue:

.attr("width", "100000");

If you can't remove the line, it appears you can force chrome to re-render it like this

document.querySelectorAll('foreignObject').forEach(x=>{
    x.parentElement.style.display='none';
    setTimeout(()=>{x.parentElement.style.display=''},1);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant