I've created a component in Angular 5 that will be used to indicate progress through a number of stages. It works great in Chrome, but when testing it in IE11 it has some odd behaviour that renders it unusable.
The component uses an SVG and generates the elements of the image using Angular directives and attribute bindings. In IE11 it does not render all of the elements immediately. It will load the empty progress bar and the "Stage 1" label. If I click into one of the text boxes and then click away it will load the "Stage 2" label. After repeating this several times it will eventually render everything. However, when changing the values in the text boxes the update doesn't happen as smoothly as it does in Chrome.
Here is a StackBlitz sample demonstrating the issue.
It seems to be a problem related to using ngFor on an SVG element, but I have no idea why or how to resolve it.
Any help would be greatly appreciated.
---------- EDIT -------------
I have since found that the issue is caused by one particular angular binding. If I remove the following binding from line 14 of progress-stage-bar.component.html then IE works as expected.
[class.current-stage]="isCurrentStage(stage)"
I have tried to replace this with [ngClass] instead, but the same issue occurs.
Can anyone please help me understand why this is a problem for Internet Explorer when it works without an issue in Chrome?
svg:
selector to tell Angular it should avoid treating it as a custom element. Find more information here - user4676340svg:
prefix is good practice but is not strictly necessary unless your SVG elements will be spread over multiple components. I did try it, just in case, but it still didn't seem to work. - TheCrimsonSpace