question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem on IE11 and SVG

See original GitHub issue

Hi and happy new year!

Issue

I have an issue with SVG circle, IE11 and tippy.js (which use popper.js): The tooltips don’t work. I have an alert message in the console: The object does not handle the property or method "contains": 649,3 which seems to be related with popper.js (the other warning message is related to tippy.js)

Do you think you could help me?

CodePen demo

https://codepen.io/Julien-Jolly/pen/pprydG

What is the expected behavior?

You should see and interact with the tooltip

What went wrong?

No tooltip at all 😢

Browser

IE11 on Windows 10 (work on Edge and Chrome, FF…)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
taltruicommented, Jun 24, 2019

@FezVrasta Sorry for bringing up such an old issue, but I’ve found that contains is part of the HTMLDivElement prototype, so I think it is safer and maybe faster to use a that one instead:

if (!SVGElement.prototype.contains)  SVGElement.prototype.contains = HTMLDivElement.prototype.contains;

And you could add this polyfill in the code, since it won’t have any effect if contains is already present.

4reactions
FezVrastacommented, Jan 3, 2018

It looks like IE11 doesn’t support the method “contains” on SVG nodes… I’m not surprised.

You may polyfill it:

SVGElement.prototype.contains = function contains(node) {
	if (!(0 in arguments)) {
		throw new TypeError('1 argument is required');
	}
 
	do {
		if (this === node) {
			return true;
		}
	} while (node = node && node.parentNode);
 
	return false;
};

Please let me know if it works.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SVG issues in ie11 - Stack Overflow
I was having SVG image display issue in IE11. The issue was inner svg image was having width and height mentioned.
Read more >
Fix SVGs not scaling in IE9, IE10, and IE11 - Github-Gist
IE9, IE10, and IE11 don't properly scale SVG files added with img tags when viewBox , width and height attributes are specified. View...
Read more >
Scalable Vector Graphics (SVG) files are displayed incorrectly ...
Fixes an issue in which Scalable Vector Graphics (SVG) files are displayed incorrectly in Internet Explorer 11. This issue occurs because seam mitigation...
Read more >
SVG and animated SVG not rendering in IE 11 after exporting ...
I've built a suite of Dynamic Banners that feature some animated SVG elements. They work fine when previewing in chrome/firefox etc. but when...
Read more >
SVG not displaying in IE11 on LMS - Adobe Support Community
Anyone else have issues with SVGs and Internet Explorer? I'm not sure why this is happening, but in Windows with IE11, when I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found