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.

Operating on classes doesn't work with SVG elements in IE 11

See original GitHub issue

That means NgClass is broken.

The reason is annoyingly that IE 11 doesn’t support classList on SVG elements, so adding to undefined in the BrowserDomAdapter throws.

Issue Analytics

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

github_iconTop GitHub Comments

6reactions
theFifthElfcommented, Feb 16, 2016

A small shim like this gets around the the missing classList on IE11.

if (!(“classList” in document.createElementNS(“http://www.w3.org/2000/svg","g”))) { var descr = Object.getOwnPropertyDescriptor(HTMLElement.prototype, ‘classList’); Object.defineProperty(SVGElement.prototype, ‘classList’, descr); }

I’m not suggestiing it’s a solution. The more interesting thing is that with that shim in place the SVG rendering works but the performance is very slow.

0reactions
angular-automatic-lock-bot[bot]commented, Sep 9, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

IE 11 "Crashes" when Using Dynamic SVG Elements
I was running into this with an <svg> that was dynamically added or removed from the DOM with AngularJS and ng-if . The...
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 >
Simple SVG icon not displaying in IE11
You don't need innerHTML here, you can build up the element with DOM accessors, such as createElement() , setAttribute() , and appendChild() ....
Read more >
SVG (basic support) | Can I use... Support tables for ... - CanIUse
... embed or object elements. Refers to the SVG 1.1 spec. ... Known issues (4) Resources (6) Feedback ... 3 IE9-11 & Edge...
Read more >
5 Gotchas You're Gonna Face Getting Inline SVG Into ...
It may be obvious, but this is only an issue, here, because we're ... add classes within the source SVG and apply CSS...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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