classList.js icon indicating copy to clipboard operation
classList.js copied to clipboard

ClassList not working in SVG use tag in IE11

Open SLYJason opened this issue 7 years ago • 4 comments

I'm build a angular project that I can't get classList from svg use tag in IE11, for example:

<svg class="a b c>
   <use class="d e f" [attr.xlink:href]="iconPath"/>
</svg>

I call classList of use tag in IE11, it just returned undefined. But if call classList of svg tag, it's working fine.

Note: iconPath is a component variable.

SLYJason avatar Apr 06 '18 17:04 SLYJason

point to the version of classList.js U R using

englishextra avatar Apr 07 '18 13:04 englishextra

^1.1.20150312

SLYJason avatar Apr 08 '18 00:04 SLYJason

I'm having the same issue. 1.2.20171210

curtisbelt avatar May 25 '18 00:05 curtisbelt

@SLYJason I just solved this, at least for my case.

From https://github.com/facebook/react/issues/4963

add pointer-events: none to and elements.

svg,
use {
  pointer-events: none;
}

Worth mentioning this resolved my problem without needing classList polyfill after all.

curtisbelt avatar May 25 '18 00:05 curtisbelt