Skip to content

Commit 23ce96a

Browse files
committed
chore: fix IE issues
1 parent 95198d1 commit 23ce96a

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/lib/icon/icon-registry.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,8 @@ export class MdIconRegistry {
378378
private _toSvgElement(element: Element): SVGElement {
379379
let svg = this._svgElementFromString('<svg></svg>');
380380

381-
for (let i = 0; i < element.children.length; i++) {
382-
svg.appendChild(element.children[i].cloneNode(true));
381+
for (let i = 0; i < element.childNodes.length; i++) {
382+
svg.appendChild(element.childNodes[i].cloneNode(true));
383383
}
384384

385385
return svg;

src/lib/icon/icon.spec.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,11 @@ describe('MdIcon', () => {
254254
fixture.detectChanges();
255255

256256
const svgElement = verifyAndGetSingleSvgChild(mdIconElement);
257-
const firstChild = svgElement.children[0];
257+
const path = svgElement.querySelector('path');
258258

259259
expect(svgElement.querySelector('symbol')).toBeFalsy();
260-
expect(svgElement.children.length).toBe(1);
261-
expect(firstChild.nodeName.toLowerCase()).toBe('path');
262-
expect(firstChild.getAttribute('id')).toBe('quack');
260+
expect(path).toBeTruthy();
261+
expect(path.getAttribute('id')).toBe('quack');
263262
});
264263

265264
it('should not wrap <svg> elements in icon sets in another svg tag', () => {

0 commit comments

Comments
 (0)