-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
DOMUtils.getStringSize sometimes returns 0 width #224
Comments
@amay 😭 I can't reproduce this bug. |
Thanks for taking a look. I realize I didn't give much to help in reproducing. I'll see if I can put together a little example of the bug to share with you. |
OK! Thank you! |
Ok. I figured out how to reproduce it and made a little demo showing the issue: https://flame-healer.hyperdev.space/ (click the "Switch" button to render a new graph that shows the label collision issue). The issue is that I'm using turbolinks on this project, so the body of the page gets re-rendered on page navigation. The effect of this is that the I'm not sure what the best solution for this is. I attempted some hacks to make it so turbolinks doesn't remove the span, but none of those worked. If I could clear the cached span pointer, or turn off caching that would fix this issue for me. Please let me know what seems reasonable to you. Thanks! |
Small update. I did figure out a way to store the span element and restore it after turbolinks does the page navigation, so I have a workaround for this. If there was an API for clearing this cached span that would still be cleaner, but I am at least not experiencing the bug anymore. |
@amay Thank you! Maybe we should remove span cache. |
We don't want to do that or else a new span will get added every time I made the change here #241. |
I am getting an error in the x-axis labels for a graph where the labels run into each other:
I have traced this down to the
DOMUtils.getStringSize
util function, and noticed that it returns a width of 0 in some cases.To trigger this, I render a chart on one page, navigate away from that page and navigate to another page (navigation happens on client side, so no full page reload). On the second page, the 0 width error comes up. I also noticed that if I remove the span caching from
getStringSize
everything works as well. I haven't been able to figure out why this util breaks some of the time but not all of the time. Any assistance is much appreciated.The text was updated successfully, but these errors were encountered: