I have this head-scratcher that I've been beating for the past few weeks. Hard to determine where the issue is originating, because it has specific conditions which create it.
Here is a plnkr demo:
https://plnkr.co/edit/YrBGTBSohmbnZbQ8m2Yo?p=preview (see the bug in Firefox and IE Edge; there are cases where Chrome fails too, but wasn't able to reproduce that in plnkr).
Conditions:
- icon rendered as svg-sprite using
<defs>mode (the sprite must be in defs mode to work with angular-material's md-icon element). - svg icon is using clip-path circle.
- clip-path circle fails when the icon is rendered more than once on the page, but only when one instance is hidden/removed from DOM. In Firefox (and rarely in Chrome too), the icon will be rendered as a square instead. In IE Edge, the icon appears transparent.
My guess is there might be an issue with the id references at a browser level.
<md-icon>element is rendered, if you look inside, there is an<svg id="...">element, right? And this id matches the other instances where this icon is used, causing the conflict, correct? I knew it was something like that, just didn't know where the id conflict was happening. Thanks for pointing it out. - ngDeveloper