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

svg offsetHeight/offsetWidth deprecated in chrome #64

Closed
edenadler opened this issue Dec 5, 2017 · 3 comments
Closed

svg offsetHeight/offsetWidth deprecated in chrome #64

edenadler opened this issue Dec 5, 2017 · 3 comments

Comments

@edenadler
Copy link

When using the tooltip on an svg image, I got this error: "Warning: NaN is an invalid value for the left css style property."

The issue is that on svg type elements, the offsetHeight and offsetWidth is deprecated so it returns undefined. I tried swapping them with getBoundingClientRect().width and getBoundingClientRect().height but it isn't exactly the same and the tooltip wasn't placed where it should be.

Would be great if this could work with svgs as well. Thanks!

@romainberger
Copy link
Owner

Hi,
Would you mind sharing the code you've tested with getBoundingClientRect? I've quickly tested and it seems to work as expected:

capture d ecran 2017-12-05 a 11 53 17

Thanks

@edenadler
Copy link
Author

Turns out there was something else influencing it's position on my end, the getBoundingClientRect().width and height works great.

@romainberger
Copy link
Owner

Alright, I've published a fix in v2.1.4 that worked for me, let me know if you still have an issue.
Thank you

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

2 participants